• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Static analyzer making unwarranted assumptions about ivars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Static analyzer making unwarranted assumptions about ivars
      • From: Devin Coughlin <email@hidden>
References: 
 >Static analyzer making unwarranted assumptions about ivars (From: Jens Alfke <email@hidden>)
 >Re: Static analyzer making unwarranted assumptions about ivars (From: Devin Coughlin <email@hidden>)
 >Re: Static analyzer making unwarranted assumptions about ivars (From: Jens Alfke <email@hidden>)
 >Re: Static analyzer making unwarranted assumptions about ivars (From: Wim Lewis <email@hidden>)
 >Re: Static analyzer making unwarranted assumptions about ivars (From: Devin Coughlin <email@hidden>)

  • Prev by Date: Re: Static analyzer making unwarranted assumptions about ivars
  • Next by Date: Re: Question about debugging OS X Auto Layout
  • Previous by thread: Re: Static analyzer making unwarranted assumptions about ivars
  • Next by thread: Re: Static analyzer making unwarranted assumptions about ivars
  • Index(es):
    • Date
    • Thread