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: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Carlos O'Donell <carlos at redhat 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 21:00:01 +0000
- 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>
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.
--
Joseph S. Myers
joseph@codesourcery.com