Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2003 23:12:25 +0100
From:      David Taylor <davidt@yadt.co.uk>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/56206: src/sys/sys/cdefs.h uses PreProcessor variables that aren't defined, causing noisy warnings.
Message-ID:  <20030830221225.GB8404@gattaca.yadt.co.uk>
In-Reply-To: <200308302030.h7UKU5xO055369@freefall.freebsd.org>
References:  <200308302030.h7UKU5xO055369@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <wollman@khavrinen.lcs.mit.edu>
> To: Larry Rosenman <ler@lerctr.org>
> 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"



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