From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 30 15:12:34 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 BA5E716A4BF for ; Sat, 30 Aug 2003 15:12:34 -0700 (PDT) Received: from mail.yadt.co.uk (yadt.demon.co.uk [158.152.4.134]) by mx1.FreeBSD.org (Postfix) with SMTP id 253F843FF2 for ; Sat, 30 Aug 2003 15:12:31 -0700 (PDT) (envelope-from davidt@yadt.co.uk) Received: (qmail 32766 invoked from network); 30 Aug 2003 22:12:27 -0000 Received: from unknown (HELO mail.gattaca.yadt.co.uk) (@10.0.0.2) by yadt.demon.co.uk with SMTP; 30 Aug 2003 22:12:27 -0000 Received: (qmail 11404 invoked by uid 1000); 30 Aug 2003 22:12:26 -0000 Date: Sat, 30 Aug 2003 23:12:25 +0100 From: David Taylor To: Garrett Wollman Message-ID: <20030830221225.GB8404@gattaca.yadt.co.uk> Mail-Followup-To: Garrett Wollman , freebsd-bugs@FreeBSD.org References: <200308302030.h7UKU5xO055369@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <200308302030.h7UKU5xO055369@freefall.freebsd.org> User-Agent: Mutt/1.4.1i cc: freebsd-bugs@FreeBSD.org Subject: Re: misc/56206: src/sys/sys/cdefs.h uses PreProcessor variables that aren't defined, causing noisy warnings. 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: Sat, 30 Aug 2003 22:12:34 -0000 On Sat, 30 Aug 2003, Garrett Wollman wrote: > The following reply was made to PR misc/56206; it has been noted by GNATS. > > From: Garrett Wollman > To: Larry Rosenman > Cc: FreeBSD-gnats-submit@freebsd.org > Subject: Re: misc/56206: src/sys/sys/cdefs.h uses PreProcessor variables > that aren't defined, causing noisy warnings. > Date: Sat, 30 Aug 2003 16:26:52 -0400 (EDT) > >>>> -#if __STDC_VERSION__ < 199901 >>>> +#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901 >>> >>> 0 < 199901 >> and doesn't the #if __STDC_VERSION__ < 199901 have the same effect, except > > Let me try to spell this out. > > When __STDC_VERSION__ is not defined, the preprocessor expression > `__STDC_VERSION < 199901' evaluates, by definition, to true, because > 0L < 199901L (which is why I consider this GCC warning to be bogus). > > When __STDC_VERSION__ is not defined, the preprocessor expression > `defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901' evaluates to > false, because __STDC_VERSION__ is not defined. > > -GAWollman Presumably the patch: -#if __STDC_VERSION__ < 199901 +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901) Would keep the original behaviour, and silence GCC's warning. Whether you you want to apply the patch or change GCC, however, isn't a decision I am remotely qualified to make... -- David Taylor davidt@yadt.co.uk "The future just ain't what it used to be"