Skip site navigation (1)Skip section navigation (2)
Date:      04 Mar 2001 14:03:34 +0100
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        audit@FreeBSD.ORG, cracauer@FreeBSD.ORG, bde@FreeBSD.ORG
Subject:   Re: -Wnon-const-format patches, Pt 1
Message-ID:  <xzpitlpit3t.fsf@flood.ping.uio.no>
In-Reply-To: Kris Kennaway's message of "Sat, 3 Mar 2001 15:13:34 -0800"
References:  <20010303151334.A33979@mollari.cthul.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kennaway <kris@obsecurity.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpitlpit3t.fsf>