include: add no return function attribute

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>
This commit is contained in:
Sami Kerola 2019-02-08 22:01:05 +00:00 committed by Karel Zak
parent 123eb9ef8c
commit e73456dfbb
1 changed files with 2 additions and 1 deletions

View 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);
}