Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Oct 2003 13:42:27 -0700
From:      Eric Anholt <eta@lclark.edu>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        "Jukka A. Ukkonen" <jau@mawit.com>
Subject:   Re: Minor change to silence complaints from cpp
Message-ID:  <1065472947.637.1.camel@leguin>
In-Reply-To: <20031006232811.D9454@gamplex.bde.org>
References:  <200310020933.h929XI8r028284@freefall.freebsd.org> <3131.62.78.135.6.1065426014.squirrel@office.mawit.com> <20031006232811.D9454@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2003-10-06 at 06:41, Bruce Evans wrote:
> On Mon, 6 Oct 2003, Jukka A. Ukkonen wrote:
> 
> > E.g. when compiling X-server cpp has been complaining about
> > _POSIX_C_SOURCE not being defined. This was easily silenced
> > with the following minor change...
> 
> This seems to be a bug or a feature in the X server's Makefile.  It
> apparently uses -Wundef to generate warnings about the Standard C
> feature of undefined identifiers having value 0 in cpp expressions.
> 
> > --- /usr/include/sys/cdefs.h.orig	Mon Oct  6 10:26:47 2003
> > +++ /usr/include/sys/cdefs.h	Mon Oct  6 10:28:06 2003
> > @@ -270,13 +270,13 @@
> >   */
> >
> >  /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
> > -#if _POSIX_C_SOURCE == 1
> > +#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE == 1)
> >  #undef _POSIX_C_SOURCE		/* Probably illegal, but beyond caring now. */
> >  #define	_POSIX_C_SOURCE		199009
> >  #endif
> >
> >  /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
> > -#if _POSIX_C_SOURCE == 2
> > +#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE == 2)
> >  #undef _POSIX_C_SOURCE
> >  #define	_POSIX_C_SOURCE		199209
> >  #endif
> 
> I'd prefer not to uglify the system headers to support -Wundef.
> 
> Most warnings in system headers including ones from -Wundef can be
> suppressed using -Wno-system-headers.  -Wno-system-headers is the FSF
> default but FreeBSD reverses this.

XFree86-4-Server-snap and XFree86 upstream have been patched to use
-Wno-system-headers with gcc3 so we can avoid this noise.  Doesn't help
on -stable, though.

-- 
Eric Anholt                                eta@lclark.edu          
http://people.freebsd.org/~anholt/         anholt@FreeBSD.org




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