r183713 - Objective-C [qoi]: Issue better warning when nsstring literal is missing

Arthur O'Dwyer arthur.j.odwyer at gmail.com
Mon Jun 10 17:12:11 PDT 2013


On Mon, Jun 10, 2013 at 4:51 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>
> +def warn_missing_atsign_prefix : Warning<
> +  "string literal must be prefixed by '@' ">, InGroup<ObjCLiteralMissingAtSign>;

Shouldn't this say "NSString literal", not "string literal"?
Objective-C has the same
string literals as C and C++, and they don't need to be prefixed by
'@'. I feel like
overriding the term "string literal" in this message to refer
specifically to NSString
literals is actually more confusing than it is helpful.

(Personally, I liked the old diagnostic. It helpfully showed the
formal and actual
parameter types so you could see how they mismatched and how to fix it. This
new warning is basically just saying "Hey. Add an '@' here. Trust me.")

-Arthur



More information about the cfe-commits mailing list