Re: Strange type-punning warning
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