diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-05-16 20:14:22 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-05-16 20:14:22 +0200 |
| commit | 0f03cc378e6ce48f17a20e409f93bfc11345a6ed (patch) | |
| tree | f4768c6fe96e1ac2a9c5833dee897924300d4a45 /src/util.h | |
| parent | Add blind-tempral-mean (diff) | |
| download | blind-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.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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" |
