Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Sep 2001 01:53:54 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>
Cc:        Brian Somers <brian@freebsd-services.com>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/sys cdefs.h
Message-ID:  <20010915012754.C19795-100000@delplex.bde.org>
In-Reply-To: <20010914162623.K17490@daemon.ninth-circle.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 14 Sep 2001, Jeroen Ruigrok van der Werven wrote:

> -On [20010914 14:58], Bruce Evans (bde@zeta.org.au) wrote:
> >Yes, this change is backward.  It undoes the main part of rev.1.17.
> >No special #define's are required to correctly break the compiles,
> >since __attribute__(()) is already a syntax error.
>
> Of course, __attribute__ is, for all I know, a GCC'ism.  C90 and C99
> don't have it in their description.
>
> This is merely a solution to fix the exposure of
> __attribute__((__format_arg__(2))) in stdio.h, which, due to not being
> properly wrapped, breaks compilers or other tools, which do not know the
> __attribute__ keyword, e.g. TenDRA. [Which is what I was trying to fix.]

The correct fix for that is to properly wrap it.

> >This regression may be related to breakage of lint(1).  lint(1) now
> >uses a wrong version of cpp, one that pre-defines __GNUC__.  Since lint
> >is not gcc, this defeats all the __GNUC__ ifdefs in <sys/cdefs.h>.  In
> >particular, __attributes__'s in important macros like __printflike are
> >exposed to lint and lint barfs on important headers like <stdio.h> that
> >expand these macros.
>
> lint's set-up is something I am still looking at and working on.
>
> I looked at the output of cpp -dD -E of stdio.h and the resulting code
> appears to be valid for the compiler, but the best solution, if judging
> by the proper specs, would be to wrap the __attribute__ occurence in
> stdio.h then, right?  And provide a non-gcc version of fmtcheck.

Running cpp directly normally gives a correct version of cpp, but lint
doesn't use it (it uses cc -E -x c -D...).

I think fmtcheck()'s attributes are only useful for gcc.  fmtcheck()
can be implemented in Standard C.  fmtcheck.c already seems to be
portable -- TenDRA compiles it OK.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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