Re: Static analyzer making unwarranted assumptions about ivars
Re: Static analyzer making unwarranted assumptions about ivars
- Subject: Re: Static analyzer making unwarranted assumptions about ivars
- From: Jens Alfke <email@hidden>
- Date: Tue, 15 Mar 2016 21:57:08 -0700
On Mar 15, 2016, at 5:53 PM, Devin Coughlin < email@hidden> wrote:
You can get false positives like this if you use custom assertion macros in your project. In this case you would need to annotate the assertion handler (the part of the assertion macro that aborts when the check fails) with __attribute__((analyzer_noreturn)).
I use the more-standard __attribute__((noreturn)) on my assertion-failed handlers.
I notice that the docs you linked to say "currently, clang does not support these attributes on Objective-C methods and C++ methods” — is that still true? I’ve got a couple of C++ methods marked as “[[noreturn]]”:
struct error : public std::exception { ... [[noreturn]] static void _throw(fdb_status); [[noreturn]] static void assertionFailed(const char *func, const char *file, unsigned line, const char *expr); };
For Clang’s sake should I change those into regular functions? And does the analyzer recognize C++11’s “[[noreturn]]” syntax?
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden