This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH 06/13] Installed header hygiene (BZ#20366): Macros used in #if without checking whether they are defined.
- From: Zack Weinberg <zackw at panix dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Wed, 21 Sep 2016 14:08:56 -0400
- Subject: Re: [PATCH 06/13] Installed header hygiene (BZ#20366): Macros used in #if without checking whether they are defined.
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
On Wed, Sep 21, 2016 at 2:02 PM, Carlos O'Donell <email@example.com> wrote:
>> * misc/sys/cdefs.h: Tidy up conditional nest defining __flexarr.
>> Define __flexarr_is_fake when the compiler does not support
>> flexible array members.
> This patch fails to follow the Macro API best practice that all macros
> be defined and that we should check for their values not their defined-ness
> which can introduce subtle errors e.g. __flexarr_is_fake.
Doh, I should have remembered that. I think I'll also flip the sense
and call it __glibc_c99_flexarr_available. It's a bit of a mouthful
but it makes for a clearer test at the point of use.
> At a high level I would expect _LIBC to always be defined as either 0 or 1.
My expectation is actually that it is either undefined or 1, for
historical reasons, but I wouldn't want to swear that it never gets
defined to be 0.