Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 May 2013 17:50:54 +0200
From:      Stefan Farfeleder <stefanf@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@FreeBSD.org, Ed Schouten <ed@80386.nl>, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r250806 - head/sys/sys
Message-ID:  <20130520155053.GC1429@mole.fafoe.narf.at>
In-Reply-To: <20130521004803.K8511@besplex.bde.org>
References:  <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> <CAJOYFBC3Ww-jdy2cm7QNEbVzrZJHaeo3y797BVYp53pKJ5e-Nw@mail.gmail.com> <20130520140304.GA1429@mole.fafoe.narf.at> <20130521004803.K8511@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 21, 2013 at 01:15:11AM +1000, Bruce Evans wrote:
> On Mon, 20 May 2013, Stefan Farfeleder wrote:
> 
> > I think you misunderstood what I meant. We now have quiet a few
> > occurrences of `#ifdef lint' or equivalent in /usr/include. I think those
> > should be changed to `#ifdef __lint' to allow application code to do
> >
> > #define lint foo
> > #include <header.h>
> >
> > which is perfectly fine POSIX code (at least to my knowledge) and should
> > not change the behaviour of the included header.
> 
> lint actually predefines __LINT__, not __lint.

__LINT__ is fine with me. I didn't bother to read lint's source, but the
man page states:

"The lint utility runs the C preprocessor as its first phase, with the
preprocessor symbol “lint” defined to allow certain questionable code to be
altered or skipped by lint.  Therefore, this symbol should be thought of as a
reserved word for all code that is to be checked by lint."

> Of course it is a bug that system headers depend on symbols in the
> application namespace like lint.  My version never had the lint ifdef(s)
> in sys/cdefs.h.  I don't like them for other reasons.  They results in
> lint checking different source code to what the compiler sees.  FreeBSD's
> lint barely supports C90, but C99 features like C99 initializers are now
> used extensively, at least in the kernel.  Use of features like this
> can't be hidden from lint using a few ifdefs in headers.

Since nobody wants to update lint to recent C standards, maybe it's time to
remove it?

Stefan



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