• 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: Strange type-punning warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange type-punning warning


  • Subject: Re: Strange type-punning warning
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 29 Sep 2006 11:03:35 -0400
  • Organization: Rogue Research

On 2006-09-28 19:10, Bob Currier said:

>When -fstrict-aliasing is enabled, I get quite a few warnings of the type:
>
>warning: type-punning to incomplete type might break string-aliasing rules
>
>I know what type-punning and aliasing are, but the statement I'm getting
>this on is the assignment:
>
>    NavDialogCreateOptions      navOptions;

You mean NavDialogCreationOptions.

>    navOptions.saveFileName = CFSTR("untitled");
>
>
>I've looked at the definition of NavDialogCreateOptions and don't see
>any opportunities for type-punning. Casting CFSTR to a CFStringRef makes
>no difference (of course).

For fun, I turned on -fstrict-aliasing in a new project that has very
many warnings enabled and builds cleanly, now I have dozens of
warnings.  Even these warn:

 CFStringRef		foo = CFSTR("untitled");
	NSLog (@"hello");

Which, to me, makes -fstrict-aliasing pretty darn useless.

Maybe it is a funky macro nature of CFSTR() that is causing the problem.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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: 
 >Strange type-punning warning (From: "Bob Currier" <email@hidden>)

  • Prev by Date: Xcode template - Image copying problem and enclosing folder on disk issue
  • Next by Date: Re: Xcode template - Image copying problem and enclosing folder on disk issue
  • Previous by thread: Strange type-punning warning
  • Next by thread: MyApp crashing with EXC_BADACCESS
  • Index(es):
    • Date
    • Thread