On 11/03/2015 02:32 AM, Paul Eggert wrote:
> Pedro Alves wrote:
>> Instead of trying to detect the right types, detect
>> good-enough-pre-C++11 stdint.h and in such case make the substitute
>> stdint.h just wrap the system's stdint.h with
>> __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
> 
> Instead, how about just adding the necessary #defines for 
> __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS to config.h if they are needed to 
> fix 
> the bug?  Then we can leave stdint.h alone (perhaps not even build stdint.h 
> at all).

The downside could be that config.h's #defines are unconditional, instead of 
guarded
against multiple definition with #ifndef, as they are currently in the 
replacement
stdint.h.  I was worried (a bit) that that may break packages that have build
systems that pass something like -D__STDC_CONSTANT_MACROS on the command line.

But because -DFOO defines FOO as 1, this doesn't error out:

  echo "#define FOO 1" | g++ -Werror -DFOO -E -

Given that config.h defines symbols to 1, I guess that concern is moot.

(But that speaks nothing of other compilers gnulib supports, naturally.)

I'll update the patch in that direction.

Thanks,
Pedro Alves


Reply via email to