[cfe-dev] False positive warning: "warning: 'terminate:' is deprecated"?

Sean McBride sean at rogue-research.com
Mon Dec 12 10:48:20 PST 2011


On Mon, 12 Dec 2011 10:34:17 -0800, Eli Friedman said:

>> With clang version 3.1 (trunk 146375) the code below generates a false
>positive warning:
>>
>> test.m:7:6: warning: 'terminate:' is deprecated [-Wdeprecated-declarations]
>>    [NSApp terminate:nil];
>>     ^
>>
>> As best as I can tell, that method is not deprecated.  The global
>variable NSApp is declared as 'id'.  If I cast it to NSApplication* the
>warning goes away.  This warning did not occur a few weeks ago, nor does
>it with gcc.
>>
>> Is it a bug or am I missing something?
>
>This change was made intentionally in r145999.  There are multiple
>methods called terminate in Cocoa.h, and one of them (specifically,
>the one on NSInputServiceProvider) is deprecated.  It's possible the
>heuristic and/or the headers need tweaks.

Do you want me to file a bug?

I've never understood why the NSApp global is 'id' and not 'NSApplication*'.  This has caused other warnings in the past, like <rdar://6845498>.

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada






More information about the cfe-dev mailing list