• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Suppressing pointer sign warnings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Suppressing pointer sign warnings (From: Andreas Falkenhahn <email@hidden>)

  • Prev by Date: Debugging my iPad resident app from XCode
  • Next by Date: Integrate aurioTouch
  • Previous by thread: Suppressing pointer sign warnings
  • Next by thread: Xcode 3.2.6 Instruments (Leaks) Problem after 10.6.8 Update?
  • Index(es):
    • Date
    • Thread