[webkit-dev] -fstrict-aliasing error

Andrea Mannori rgveda99 at yahoo.it
Wed May 17 07:17:30 PDT 2006



Inizio messaggio inoltrato:

> Da: Andrea Mannori <rgveda99 at yahoo.it>
> Data: 16 maggio 2006 9:33:25 GMT+02:00
> A: Geoffrey Garen <ggaren at apple.com>
> Oggetto: Re: [webkit-dev] -fstrict-aliasing error
>
>
> Il giorno 15/mag/06, alle ore 17:38, Geoffrey Garen ha scritto:
>
>> Andrea,
>>
>> What warnings do you get?
>>
>> I haven't tried compiling WebCore and WebKit with -fstrict- 
>> aliasing. However, I suspect that the warnings and errors you get  
>> result from type punning through pointers. To make the code safe  
>> for strict aliasing, you would need to change all pointer-based  
>> type punning to union-based type punning.
>>
>> I think there's a compiler warning flag, like -Wstrict-aliasing,  
>> that can help you track down unsafe type punning.
>>
>
>
> here i have an example:
>
> cc1obj: warnings being treated as errors
> /Users/andrea/WebKit/WebCore/bridge/mac/WebDashboardRegion.m: In  
> function '-[WebDashboardRegion description]':
> /Users/andrea/WebKit/WebCore/bridge/mac/WebDashboardRegion.m:60:  
> warning: dereferencing type-punned pointer will break strict- 
> aliasing rules
>
> and going to the source:
>     return [NSString stringWithFormat:@"rect:%@ clip:%@ type:%s",
> so if i write
>  return [NSString stringWithFormat:(NSString *)"rect:%@ clip:%@  
> type:%s",
>
> i don' t have error more... is that correction right? it seem to me  
> no...
> and at last, even correcting all that kind of error
> And at last I cannot correct the same kind of error that retur me  
> the CFSTR macro (used in the right mode to my eyes)
>
> thankyou all
>
> Andrea
>

ps: sorry to goffrey, i have sent these message to you for wrong!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-dev/attachments/20060517/85711e22/attachment.html


More information about the webkit-dev mailing list