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

Eli Friedman eli.friedman at gmail.com
Mon Dec 12 10:34:17 PST 2011


On Mon, Dec 12, 2011 at 10:17 AM, Sean McBride <sean at rogue-research.com> wrote:
> Hi all,
>
> 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.

-Eli




More information about the cfe-dev mailing list