aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-05-16 20:14:22 +0200
committerMattias Andrée <maandree@kth.se>2017-05-16 20:14:22 +0200
commit0f03cc378e6ce48f17a20e409f93bfc11345a6ed (patch)
treef4768c6fe96e1ac2a9c5833dee897924300d4a45 /src/util.h
parentAdd blind-tempral-mean (diff)
downloadblind-0f03cc378e6ce48f17a20e409f93bfc11345a6ed.tar.gz
blind-0f03cc378e6ce48f17a20e409f93bfc11345a6ed.tar.bz2
blind-0f03cc378e6ce48f17a20e409f93bfc11345a6ed.tar.xz
Fix errors and warnings and make the code cleaner
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 4f94a88..c51dbc9 100644
--- a/src/util.h
+++ b/src/util.h
@@ -1,6 +1,12 @@
/* See LICENSE file for copyright and license details. */
#include "arg.h"
+#if defined(__GNUC__) || defined(__clang__)
+# define ATTRIBUTE_NORETURN __attribute__((noreturn))
+#else
+# define ATTRIBUTE_NORETURN
+#endif
+
#define ELEMENTSOF(ARRAY) (sizeof(ARRAY) / sizeof(*(ARRAY)))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define MAX(A, B) ((A) > (B) ? (A) : (B))
@@ -9,8 +15,9 @@
#define INTSTRLEN(TYPE) ((sizeof(TYPE) == 1 ? 3 : (5 * sizeof(TYPE) / 2)) + ((TYPE)-1 < 1))
#define USAGE(SYNOPSIS)\
+ ATTRIBUTE_NORETURN\
static void usage(void)\
- { eprintf("usage: %s%s%s\n", argv0, SYNOPSIS ? " " : "", SYNOPSIS); }
+ { eprintf("usage: %s%s%s\n", argv0, *SYNOPSIS ? " " : "", SYNOPSIS); }
#include "util/eprintf.h"
#include "util/efflush.h"