aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-12-09 23:03:16 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-12-09 23:03:16 +0100
commitb6442b828abbcb15971c4613387eb6b17ec73c27 (patch)
treea883ccfd6a7d3bf52a5010e6bd1c01ae98386037
parente632349ce9ab655bc5628656fb9b1177faf37095 (diff)
Fix GCC compiler error
-rw-r--r--grab.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/grab.c b/grab.c
index 0c3af26..ed3bbc5 100644
--- a/grab.c
+++ b/grab.c
@@ -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;