[PATCH] __FreeBSD_cc_version in <sys/cdefs.h>

mdf at FreeBSD.org mdf at FreeBSD.org
Tue Jul 5 14:38:20 UTC 2011


On Tue, Jul 5, 2011 at 6:36 AM, Robert Millan <rmh at debian.org> wrote:
> 2011/7/5 Dimitry Andric <dim at freebsd.org>:
>> As far as I can see, this code only gives warnings when compiled with
>> gcc 4.5 or higher, and when using the -Wundef flag.  Isn't it easier to
>> just remove the -Wundef flag here?
>
> Here's a patch to remove -Wundef.  I think it's a bad idea however,
> IMHO it's better to fix the cause of the warning instead.

The problem is that, IIRC, C guarantees that an undefined symbol when
checked in a #if context will evaluate to 0.  So -Wundef checks for
warnings on compliant code.

Personally I have no objection to the original patch.

Cheers,
matthew


More information about the freebsd-hackers mailing list