diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2019-03-11 09:49:05 -0700 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2019-03-11 18:21:43 +0100 |
commit | c4ca1ddb2413a354e8f49fff4680f175a02e7d8e (patch) | |
tree | 37c5608dec218af85dd0f597ad59fff1893d8239 /src/pal/inc | |
parent | 98cd595b35ced3adb6efe0c667f5160f21067e0b (diff) | |
download | coreclr-c4ca1ddb2413a354e8f49fff4680f175a02e7d8e.tar.gz coreclr-c4ca1ddb2413a354e8f49fff4680f175a02e7d8e.tar.bz2 coreclr-c4ca1ddb2413a354e8f49fff4680f175a02e7d8e.zip |
Fix no-return false positives in static analyzer build
There were about 800 false positive issues in the clang status analyzer
build caused by the fact that various forms of asserts were not considered
by the analyzer as not returning.
This change adds __attribute__((analyzer_noreturn)) (wrapped in a macro) to
those assertion functions.
Diffstat (limited to 'src/pal/inc')
-rw-r--r-- | src/pal/inc/pal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index cdb376068e..26c9e3f6d8 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -168,6 +168,12 @@ typedef PVOID NATIVE_LIBRARY_HANDLE; #define DECLSPEC_NORETURN PAL_NORETURN +#ifdef __clang_analyzer__ +#define ANALYZER_NORETURN __attribute((analyzer_noreturn)) +#else +#define ANALYZER_NORETURN +#endif + #if !defined(_MSC_VER) || defined(SOURCE_FORMATTING) #define __assume(x) (void)0 #define __annotation(x) |