From: Matthew Fernandez Date: Sun, 14 Feb 2021 17:03:17 +0000 (-0800) Subject: silence some -Wimplicit-fallthrough warnings X-Git-Tag: 2.47.0~49^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b85122f37e45fdab3184731bf667b28d38f0da2e;p=graphviz silence some -Wimplicit-fallthrough warnings --- diff --git a/cmd/lefty/aix_mods/common.h b/cmd/lefty/aix_mods/common.h index c5b47b424..08b15b005 100644 --- a/cmd/lefty/aix_mods/common.h +++ b/cmd/lefty/aix_mods/common.h @@ -78,8 +78,17 @@ extern "C" { char *buildpath(char *, int); char *buildcommand(char *, char *, int, int, char *); void warning(char *, int, char *, char *, ...); - void panic1(char *, int, char *, char *, ...); - void panic2(char *, int, char *, char *, ...); + +#ifdef __GNUC__ + // FIXME: use _Noreturn for all compilers when we move to C11 + #define NORETURN __attribute__((noreturn)) +#else + #define NORETURN /* nothing */ +#endif + NORETURN void panic1(char *, int, char *, char *, ...); + NORETURN void panic2(char *, int, char *, char *, ...); +#undef NORETURN + #endif /* _COMMON_H */ #ifdef __cplusplus diff --git a/cmd/lefty/common.h b/cmd/lefty/common.h index c2eade08f..6249d67d0 100644 --- a/cmd/lefty/common.h +++ b/cmd/lefty/common.h @@ -96,8 +96,17 @@ void term (void); char *buildpath (char *, int); char *buildcommand (char *, char *, int, int, char *); void warning (char *, int, char *, char *, ...); -void panic1 (char *, int, char *, char *, ...); -void panic2 (char *, int, char *, char *, ...); + +#ifdef __GNUC__ + // FIXME: use _Noreturn for all compilers when we move to C11 + #define NORETURN __attribute__((noreturn)) +#else + #define NORETURN /* nothing */ +#endif +NORETURN void panic1 (char *, int, char *, char *, ...); +NORETURN void panic2 (char *, int, char *, char *, ...); +#undef NORETURN + #endif /* _COMMON_H */ #ifdef __cplusplus