This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch] Fix __mips16 undef macro warnings.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Steve Ellcey <sellcey at mips dot com>, libc-alpha at sourceware dot org, yufeng dot zhang at arm dot com
- Date: Tue, 29 Apr 2014 17:15:47 -0400
- Subject: Re: [Patch] Fix __mips16 undef macro warnings.
- Authentication-results: sourceware.org; auth=none
- References: <e6d220e3-a7a2-44ba-841f-d0345c15b290 at BAMAIL02 dot ba dot imgtec dot org> <535FF3AE dot 1070301 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1404292055000 dot 14769 at digraph dot polyomino dot org dot uk>
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.