include/SDL_assert.h
changeset 8189 ab1045579b92
parent 8167 82ec2a95e664
child 8190 e63a3fe7e835
     1.1 --- a/include/SDL_assert.h	Fri Feb 07 09:35:33 2014 -0500
     1.2 +++ b/include/SDL_assert.h	Fri Feb 07 11:52:35 2014 -0500
     1.3 @@ -120,7 +120,14 @@
     1.4  /* Never call this directly. Use the SDL_assert* macros. */
     1.5  extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
     1.6                                                               const char *,
     1.7 -                                                             const char *, int);
     1.8 +                                                             const char *, int)
     1.9 +#if defined(__clang__) && __has_feature(attribute_analyzer_noreturn)
    1.10 +/* this tells Clang's static analysis that we're a custom assert function,
    1.11 +   and that the analyzer should assume the condition was always true past this
    1.12 +   SDL_assert test. */
    1.13 +   __attribute__((analyzer_noreturn))
    1.14 +#endif
    1.15 +;
    1.16  
    1.17  /* the do {} while(0) avoids dangling else problems:
    1.18      if (x) SDL_assert(y); else blah();