]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include: add no return function attribute
authorSami Kerola <kerolasa@iki.fi>
Fri, 8 Feb 2019 22:01:05 +0000 (22:01 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Apr 2019 10:57:51 +0000 (12:57 +0200)
This warning is repeated 112 times when compiling with all warnings.

xalloc.h:23:1: warning: function '__err_oom' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/xalloc.h

index 8870ac0d9e1450307e261bc0ca1eb76fa7458798..09d39aa623c6c1d922e3b6d7105a86eb8c31cb96 100644 (file)
@@ -19,7 +19,8 @@
 # define XALLOC_EXIT_CODE EXIT_FAILURE
 #endif
 
-static inline void __err_oom(const char *file, unsigned int line)
+static inline void __attribute__((__noreturn__))
+__err_oom(const char *file, unsigned int line)
 {
        err(XALLOC_EXIT_CODE, "%s: %u: cannot allocate memory", file, line);
 }