This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 06/13] Installed header hygiene (BZ#20366): Macros used in #if without checking whether they are defined.


On 09/21/2016 02:46 PM, Paul Eggert wrote:
> On 09/21/2016 11:40 AM, Carlos O'Donell wrote:
>> Isn't that just a normal coordination issue with gnulib?
> 
> I think so. Gnulib could readily change to follow whatever _LIBC
> practice is thought to be convenient for libc itself.
 
Thanks for confirming.

Best practice for macro APIs, where possible, is to always define the
macro e.g. set it to 0 or 1, and then enable the use of -Wundef to catch
any mistakes.

This isn't always possible with defines coming from other projects or
the compiler itself (where behaviour is standardized), but in our own
GNU projects I think we could adopt the less error prone usages.

I'm not suggesting Zack tackle this now.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]