gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ubuntu and Debian packages / 2013-04-10


From: Wolfgang Lux
Subject: Re: Ubuntu and Debian packages / 2013-04-10
Date: Wed, 29 May 2013 11:13:46 +0200

Niels Grewe wrote:

> On 29.05.2013 10:06CEST Philippe Roussel <address@hidden> wrote:
> 
>> DKMethod.m:618:28: error: array index of '2' indexes past the end of an 
>> array (that contains 2 elements) [-Werror,-Warray-bounds]
>>   NSAssert2((0 == strcmp(@encode(id), [sig methodReturnType])),
>>   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /usr/include/i386-linux-gnu/bits/string2.h:812:21: note: expanded from:
>>           : __strcmp_cg (s1, s2, __s1_len))                                 \
>>                          ^
>> /usr/include/i386-linux-gnu/bits/string2.h:882:25: note: expanded from:
>>                                        (__const char *) (s1))[2] - __s2[2]);\
>>                                                          ^
>> /opt/GNUstep-trunk/include/Foundation/NSException.h:454:20: note: expanded 
>> from:
>>   _NSAssertArgs((condition), (desc), (arg1), (arg2))
>>                  ^
>> /opt/GNUstep-trunk/include/Foundation/NSException.h:407:8: note: expanded 
>> from:
>>       if (!(condition)) {                                     \
>>             ^~~~~~~~~
>> DKMethod.m:618:28: error: array index of '3' indexes past the end of an 
>> array (that contains 2 elements) [-Werror,-Warray-bounds]
>>   NSAssert2((0 == strcmp(@encode(id), [sig methodReturnType])),
>>   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /usr/include/i386-linux-gnu/bits/string2.h:812:21: note: expanded from:
>>           : __strcmp_cg (s1, s2, __s1_len))                                 \
>>                          ^
>> /usr/include/i386-linux-gnu/bits/string2.h:885:27: note: expanded from:
>>                                         (__const char *)  (s1))[3]          \
>>                                                            ^
>> /opt/GNUstep-trunk/include/Foundation/NSException.h:454:20: note: expanded 
>> from:
>>   _NSAssertArgs((condition), (desc), (arg1), (arg2))
>>                  ^
>> /opt/GNUstep-trunk/include/Foundation/NSException.h:407:8: note: expanded 
>> from:
>>       if (!(condition)) {                                     \
>>             ^~~~~~~~~
>> 5 errors generated.
> 
> Now that looks fundamentally weird. I've got no clue what's going on there. 
> It works with clang trunk. Maybe a preprocessor bug that's been fixed? Could 
> you check whether replacing NSAssert2 with a plain NSAssert fixes it? 

It's apparently an issue of the weird definition that strcmp expands into (have 
a look at /usr/include/i386-linux-gnu/bits/string2.h and have fun with it). It 
uses the preprocessor to expand comparisons involving short constant strings 
into inline code. I guess someone must have spent days running microbenchmarks 
to come up with this code.

Wolfgang




reply via email to

[Prev in Thread] Current Thread [Next in Thread]