Re: Suppressing pointer sign warnings
Re: Suppressing pointer sign warnings
- Subject: Re: Suppressing pointer sign warnings
- From: Andreas Falkenhahn <email@hidden>
- Date: Mon, 27 Jun 2011 11:06:49 +0200
On 26.06.2011 at 18:25 Jeffrey Walton wrote:
>On Sun, Jun 26, 2011 at 5:20 PM, Andreas Falkenhahn
><email@hidden> wrote:
>> I'm unable to suppress the pointer signedness warnings in my Xcode
>project.
>> I've tried almost everything but the warnings don't go away. Of course I
>unchecked
>> the "Pointer Sign Comparison" setting in the project settings and the
>target
>> settings and also in the debug/release/active (debug) settings. I also
>tried to
>> add the -Wno-pointer-sign flag directly to the "Other Warning flags"
>entry. I
>> also tried to add the flag to the source file directly by selecting "Get
>Info" in
>> the file's right-click context menu and then adding -Wno-pointer-sign to
>the
>> "Additional compiler flags" text box in that dialog. But nothing helps.
>I still get
>> the warning :(
>It might not be available in GCC 4.2. I've had similar happen to me
>with template code and -Wno-type-limits. Its too bad GCC does not
>offer the version a warning shows up at
>http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html.
>
>> It's very very important that the warning goes away because currently it
>spams
>> the whole build log because I'm getting dozens and dozens of those
>warnings
>> and they conceal the really important warnings like possibly
>uninitialized variables etc.
>>
>Perhaps -Wsign-compare and -Wno-sign-compare might help (if GCC losses
>track of pointers versus signed/unsigned values).
>
>You also might try to `rm -rf build/`. Xcode has burned me more than
>once with caching.
Thanks, but that didn't help. gcc 4.2 supports the -Wno-pointer-sign
option (I tested this on the command line).
I've now found the real reason for the weird behaviour. I looked how Xcode invokes
gcc and then removed option after option until the warning finally disappeared.
And the option that caused the warning to go away was
-fpascal-strings
As soon as this option is on the command line, I'll get tons of pointer sign
warnings because I'm passing a lot of unsigned char* pointers to functions
taking signed char* pointers.
But still... why is this ancient -fpascal-strings option active by default? Who
needs these pre-diluvian Pascal strings in 2011? This option should really
be off by default...
Greets,
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden