util.h: add a note about __dead and noreturn hints - sfeed - RSS and Atom parser | |
git clone git://git.codemadness.org/sfeed | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit b2b2426f7742a8a640f1bd8bb9709452baebdca7 | |
parent 1c9433f80c0209c304236f84b58f87bd1ddf261f | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sat, 2 Nov 2024 12:31:26 +0100 | |
util.h: add a note about __dead and noreturn hints | |
- Add a note about the attribute for at least gcc/clang. | |
- _Noreturn has been deprecated. | |
- C23 introduces noreturn. | |
This is useful for testing with static analyzers like clang analyzer: | |
scan-build make | |
Running with scan-build make would return all false-positives for functions | |
using err(), errx() and die(). | |
Diffstat: | |
M util.h | 3 ++- | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/util.h b/util.h | |
@@ -57,7 +57,8 @@ enum { | |
FieldLast | |
}; | |
-/* hint for compilers and static analyzers that a function exits */ | |
+/* hint for compilers and static analyzers that a function does not return. | |
+ some compilers use: __attribute__((noreturn)), _Noreturn, noreturn */ | |
#ifndef __dead | |
#define __dead | |
#endif |