Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2000 19:36:00 -0800
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Peter Jeremy <peter.jeremy@alcatel.com.au>
Cc:        Steve Kargl <sgk@troutmask.apl.washington.edu>, audit@FreeBSD.ORG
Subject:   Re: gcc __attributes for format strings
Message-ID:  <20001130193600.A4439@Odin.AC.HMC.Edu>
In-Reply-To: <20001201134903.H1474@gsmx07.alcatel.com.au>; from peter.jeremy@alcatel.com.au on Fri, Dec 01, 2000 at 01:49:03PM %2B1100
References:  <20001126222048.A46809@citusc17.usc.edu> <200011271604.eARG49V29464@troutmask.apl.washington.edu> <20001201134903.H1474@gsmx07.alcatel.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 01, 2000 at 01:49:03PM +1100, Peter Jeremy wrote:
> In general, gcc attributes are not directly put in the code.  Rather
> there are a series of macros in <sys/cdefs.h> which map 4.4BSD
> attributes onto compiler-specific attributes.  If we move to a
> different compiler, we just need to change cdefs.h

Too bad this won't work in general.  As far as I can tell, Solaris and
IRIX use magic comments like so [from IRIX 6.4]:

/* PRINTFLIKE2 */
extern int      fprintf(FILE *, const char *, ...);
/* SCANFLIKE2 */
extern int      fscanf(FILE *, const char *, ...);

They don't appear to have any support for __dead2 like declerations on
non-returning functions though.  MSVC++ has __declspec(blah) before the
function decleration, but they don't seem to have any printf verification
support, just noreturn.  ISO should pull it's head out of it's ass and
declare a standard.  This information is just too useful for a compiler
not to have access to it when trying to catch stupid user tricks.  Of the
options I found last week when I was looking, I like gcc's __attribute__
best.  The current state of the world pretty much sucks.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.


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?20001130193600.A4439>