From owner-freebsd-audit Sun Mar 4 5: 3:42 2001 Delivered-To: freebsd-audit@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id DC01337B719; Sun, 4 Mar 2001 05:03:37 -0800 (PST) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id OAA95429; Sun, 4 Mar 2001 14:03:34 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Kris Kennaway Cc: audit@FreeBSD.ORG, cracauer@FreeBSD.ORG, bde@FreeBSD.ORG Subject: Re: -Wnon-const-format patches, Pt 1 References: <20010303151334.A33979@mollari.cthul.hu> From: Dag-Erling Smorgrav Date: 04 Mar 2001 14:03:34 +0100 In-Reply-To: Kris Kennaway's message of "Sat, 3 Mar 2001 15:13:34 -0800" Message-ID: Lines: 26 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Kris Kennaway writes: > These are the patches I have so far for format string warnings with > -Wnon-const-format, covering the bin/ tree. Please review (especially > whether I've got all the __printflike/__printf0like attributes correct > -- the difference being whether the function gracefully handles a NULL > format string, like the err() family, or through explicit checks). How about defining a wrapper macro for __printflike() that's empty except when compiling with GCC? I know there are other issues that prevent us from building our sources with other compilers, but there's no reason to add yet another. Something like this might work (contingent on Bruce's approval of the macros' names): #ifdef __GNUC__ #define PRINTFLIKE(a, b) __printflike((a), (b)) #define PRINTF0LIKE(a, b) __printf0like((a), (b)) #else #define PRINTFLIKE(a, b) #define PRINTF0LIKE(a, b) #endif DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message