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] Fix __mips16 undef macro warnings.


On 04/29/2014 05:00 PM, Joseph S. Myers wrote:
> On Tue, 29 Apr 2014, Carlos O'Donell wrote:
> 
>> * In a central mips header:
>>
>> /* Long description about this coming from the compiler and
>>    indicating that it will not be defined when not compiling
>>    MIPS16.  */
>> #ifdef __mips16
>> #define __glibc_mips16 1
>> #else
>> #define __glibc_mips16 0
>> #endif
> 
> longlong.h is shared, so a central header defining __glibc_* macros makes 
> no sense whatsoever.
> 
> There may be cases for converting compiler-defined macros to glibc-defined 
> macros with the 0/1 convention (e.g. replacing tests of __ARM_ARCH_* with 
> tests of __ARM_ARCH and defining that if the compiler is too old to define 
> it itself), but this isn't one of them.  And generally, if a simple 
> defined/undefined test is sufficient for the relevant condition, I think 
> defining a 0/1 macro is overkill.

Agreed, this was just an example.

For the record I like the idea of converting compiler macros to 0/1
conventions.

Cheers,
Carlos.


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