From 7ae07138436c9700c65192c4fbc3015819999666 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 8 Nov 2022 18:23:21 -0800 Subject: Mark help(), usage(), and grammar() with _X_NORETURN _X_COLD Resolves gcc -Wsuggest-attribute=noreturn warning Signed-off-by: Alan Coopersmith --- xprop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xprop.c b/xprop.c index 1138cfa..7c2bb36 100644 --- a/xprop.c +++ b/xprop.c @@ -1845,12 +1845,14 @@ print_help (void) fprintf (stderr, "%s\n", help_message); } -void help (void) { +void _X_NORETURN _X_COLD +help (void) +{ print_help(); exit(0); } -void +void _X_NORETURN _X_COLD usage (const char *errmsg) { if (errmsg != NULL) @@ -1860,7 +1862,7 @@ usage (const char *errmsg) exit (1); } -static void +static void _X_NORETURN _X_COLD grammar (void) { printf ("Grammar for xprop:\n\n"); -- cgit v1.2.3