diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-12-09 23:03:16 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-12-09 23:03:16 +0100 |
commit | b6442b828abbcb15971c4613387eb6b17ec73c27 (patch) | |
tree | a883ccfd6a7d3bf52a5010e6bd1c01ae98386037 | |
parent | e632349ce9ab655bc5628656fb9b1177faf37095 (diff) |
Fix GCC compiler error
-rw-r--r-- | grab.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -16,6 +16,12 @@ # error "REG_STARTEND not defined" #endif +#ifdef __GNUC__ +# define unreachable() __builtin_unreachable() +#else +# define unreachable() +#endif + #define die(...) err(EXIT_FAILURE, __VA_ARGS__); #define diex(...) errx(EXIT_FAILURE, __VA_ARGS__); @@ -91,6 +97,7 @@ main(int argc, char **argv) case 'h': if (execlp("man", "man", "1", argv[0], NULL) == -1) die("execlp: man 1 %s", argv[0]); + unreachable(); case 'z': delim = '\0'; break; |