Inizio messaggio inoltrato:

Da: Andrea Mannori <[EMAIL PROTECTED]>
Data: 16 maggio 2006 9:33:25 GMT+02:00
A: Geoffrey Garen <[EMAIL PROTECTED]>
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!

_______________________________________________
webkit-dev mailing list
[email protected]
http://www.opendarwin.org/mailman/listinfo/webkit-dev

Reply via email to