[cfe-dev] Question about -Wreadonly-setter-attrs

Jean-Daniel Dupas devlists at shadowlab.org
Tue Jul 28 05:56:48 PDT 2009


Hello,

I have a question about Wreadonly-setter-attrs ( property attributes  
'readonly' and 'retain' are mutually exclusive ). I don't think it  
should be enabled by standard warning flags (Wmost, Wall).

It does not really make sense as declaring a readonly property as  
retain or copy is a common and legal practice. It's even required if  
you want to be able to use property re-declaration as defined here:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html#/ 
/apple_ref/doc/uid/TP30001163-CH17-SW19

And so, when this flag is on, it produce a lots of spurious warning  
IMHO.

There may be situation where you want to use it (even if I don't see  
one yet), but I think it should only be part of an "extra-extra"  
warning group and should not be part of common warnings (-Wmost ? )





More information about the cfe-dev mailing list