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 ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature