From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 6 06:42:56 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AC1F16A4B3 for ; Mon, 6 Oct 2003 06:42:56 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 627B143FB1 for ; Mon, 6 Oct 2003 06:42:54 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id XAA28199; Mon, 6 Oct 2003 23:42:46 +1000 Date: Mon, 6 Oct 2003 23:41:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "Jukka A. Ukkonen" In-Reply-To: <3131.62.78.135.6.1065426014.squirrel@office.mawit.com> Message-ID: <20031006232811.D9454@gamplex.bde.org> References: <200310020933.h929XI8r028284@freefall.freebsd.org> <3131.62.78.135.6.1065426014.squirrel@office.mawit.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-bugs@freebsd.org Subject: Re: Minor change to silence complaints from cpp X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2003 13:42:56 -0000 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. Bruce