gnustep-dev
[Top][All Lists]
Advanced

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

Re: Compiler warnings with the new base code


From: Fred Kiefer
Subject: Re: Compiler warnings with the new base code
Date: Thu, 18 Feb 2010 09:06:33 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0

Am 15.02.2010 15:18, schrieb Richard Frith-Macdonald:
> On 15 Feb 2010, at 13:47, Fred Kiefer wrote:
>> After the reorganisation of base I get a lot more compiler warnings
>> then before. It would be great if somebody could look into these. I
>> am using gcc 4.4.1 on a 64 bit system.
> 
> I don't actually have access to a 64bit system at the moment (I do
> everything on my laptop in either a gnu/linux or mswindows 32bit
> virtual machine nowadays). I'll see if I can get a 64bit system up
> and running at some point soon, but it's not going to be immediate.

The latest version of base added a few new warnings :-)

Beside the ones we already know about:

GSObjCRuntime.m: In function ‘GSObjCMethodNames’:

GSObjCRuntime.m:154: warning: dereferencing type-punned pointer will
break strict-aliasing rules
GSObjCRuntime.m:154: warning: dereferencing type-punned pointer will
break strict-aliasing rules
In file included from GSObjCRuntime.m:1212:

../../Headers/Additions/GNUstepBase/GSIMap.h: In function
‘GSIMapCountByEnumeratingWithStateObjectsCount’:
../../Headers/Additions/GNUstepBase/GSIMap.h:981: warning: dereferencing
type-punned pointer will break strict-aliasing rules


We now also have these:

Compiling file NSMethodSignature.m ...

NSMethodSignature.m: In function ‘-[NSMethodSignature
_initWithObjCTypes:]’:
NSMethodSignature.m:417: warning: format ‘%d’ expects type ‘int’, but
argument 3 has type ‘NSUInteger’
NSMethodSignature.m:423: warning: format ‘%d’ expects type ‘int’, but
argument 3 has type ‘NSUInteger’

Compiling file NSSpellServer.m ...

NSSpellServer.m: In function ‘-[NSSpellServer
_findMisspelledWordInString:language:ignoredWords:wordCount:countOnly:]’:


NSSpellServer.m:440: warning: passing argument 4 of
‘spellServer:findMisspelledWordInString:language:wordCount:countOnly:’
from incompatible pointer type

NSSpellServer.m:440: note: expected ‘NSInteger *’ but argument is of
type ‘int *’

 Compiling file NSString.m ...

NSString.m: In function ‘+[NSString initialize]’:

NSString.m:598: warning: ‘register_printf_function’ is deprecated
(declared at /usr/include/printf.h:107)
NSString.m:603: warning: passing argument 3 of
‘register_printf_function’ from incompatible pointer type
/usr/include/printf.h:107: note: expected ‘int (*)(const struct
printf_info *, size_t,  int *)’ but argument is of type ‘int (*)(const
struct printf_info *, size_t,  NSInteger *)’



They mean real trouble as this code will fail on all platforms where
NSInteger is different from int. Some of these should be easy to
resolve, others look really annoying.




reply via email to

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