[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extern-inline: be -Wundef safe in config.h

From: Eric Blake
Subject: Re: extern-inline: be -Wundef safe in config.h
Date: Fri, 28 Sep 2012 07:21:47 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 09/28/2012 07:13 AM, Akim Demaille wrote:
> Le 28 sept. 2012 à 14:43, Eric Blake a écrit :
> hi Eric,
>> Concur - we can wait for a report of failure from someone using non-gcc
>> but where their compiler warns about undefined macros (since C99
>> guarantees the behavior of undefined macros, and -Wundef really exists
>> more to cater to K&R compilers, I doubt we will get any such reports).
> There's some room between K&R and C99 :)  Is it ok with C90?

You made me dig, but yes, C89 guarantees:

   Prior to evaluation, macro invocations in the list of preprocessing
tokens that will become the controlling constant expression are
replaced (except for those macro names modified by the defined unary
operator), just as in normal text.  If the token defined is generated
as a result of this replacement process, the behavior is undefined.
After all replacements are finished, the resulting preprocessing
tokens are converted into tokens, and then all remaining identifiers
are replaced with 0 .

-Wundef really is anachronistic; it's a shame that people use it.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]