From 2f40ca28a4d63df941525801735d05b5b2b86f91 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 24 Sep 2012 17:21:19 +0200 Subject: Annotate internal_error with the attribute noreturn Annotating functions that do not return with the noreturn attribute (which is understood by both gcc and clang) prevents static analyzers from generating false positives (internal_error is used to terminate the process and is used extensively in error handling code paths). Remove the return statement that was placed there to appease the compiler. Functions annotated with noreturn are not supposed to return any values. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> --- util/error_util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'util/error_util.c') diff --git a/util/error_util.c b/util/error_util.c index 630d2281..d6e60fc9 100644 --- a/util/error_util.c +++ b/util/error_util.c @@ -24,7 +24,7 @@ #include "error_util.h" -int +void _internal_error (const char *format, ...) { va_list va_args; @@ -35,7 +35,5 @@ _internal_error (const char *format, ...) vfprintf (stderr, format, va_args); exit (1); - - return 1; } -- cgit v1.2.3