about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-30 21:34:54 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-30 21:34:54 +0200
commit779f03de7f9df67b37676ef1293dc895120bbd77 (patch)
treec3e3f08863178e02fd468b1e39d3e9be7930623a
parent9098bbd6fc49154980c07e7c401acd799fb92773 (diff)
downloadlr-779f03de7f9df67b37676ef1293dc895120bbd77.tar.gz
lr-779f03de7f9df67b37676ef1293dc895120bbd77.tar.xz
lr-779f03de7f9df67b37676ef1293dc895120bbd77.zip
parse_error: portably declare noreturn
Squelches many clang-analyzer false positives.
-rw-r--r--lr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index 777b137..6baab9a 100644
--- a/lr.c
+++ b/lr.c
@@ -57,6 +57,16 @@
 #include <time.h>
 #include <unistd.h>
 
+#ifdef __has_include
+  #if __has_include(<stdnoreturn.h>)
+    #include <stdnoreturn.h>
+  #else
+    #define noreturn /**/
+  #endif
+#else
+  #define noreturn /**/
+#endif
+
 /* For Solaris. */
 #if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE)
 #define FNM_CASEFOLD FNM_IGNORECASE
@@ -203,7 +213,7 @@ struct expr {
 
 static char *pos;
 
-static void
+noreturn static void
 parse_error(const char *msg, ...)
 {
 	va_list ap;