This is the mail archive of the
mailing list for the glibc project.
Re: [Patch] Fix __mips16 undef macro warnings.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Steve Ellcey <sellcey at mips dot com>, libc-alpha at sourceware dot org
- Cc: yufeng dot zhang at arm dot com
- Date: Tue, 29 Apr 2014 14:52:20 -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>
On 04/29/2014 02:47 PM, Carlos O'Donell wrote:
>> OK to checkin?
>> Steve Ellcey
>> 2014-04-29 Steve Ellcey <firstname.lastname@example.org>
>> * stdlib/longlong.h: Use 'defined()' to check __mips16.
>> diff --git a/stdlib/longlong.h b/stdlib/longlong.h
>> index d45dbe2..070b40c 100644
>> --- a/stdlib/longlong.h
>> +++ b/stdlib/longlong.h
>> @@ -848,7 +848,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
>> #define UMUL_TIME 10
>> #define UDIV_TIME 100
>> -#if (__mips == 32 || __mips == 64) && ! __mips16
>> +#if (__mips == 32 || __mips == 64) && ! defined (__mips16)
>> #define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
>> #define COUNT_LEADING_ZEROS_0 32
In case it wasn't clear my recommendation is:
Add a large descriptive comment about the use of __mips16
here and perhaps even talk about __mips32 and __mips64.
Given the fact that this header is shared we can't enforce
the same kind of source rules we enforce in glibc, and
therefore the documentation of the define is enough to meet
the idea of the goal for glibc right now.
My other rant was just to set you straight if you decide
to fix more of these [-Wundef] warnings. Eventually we're
going to make this an error and then we get a lot of benefits
from this process and remove a whole class of bugs dealing
with undefined macros (which is why we want documentation
in detail for macros that are checked with `defined' or