summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-08 18:23:21 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-14 16:54:08 -0800
commit7ae07138436c9700c65192c4fbc3015819999666 (patch)
treecfc9b94ba8b3e316c18e5a2d5d467b092d384b1e
parent55c9f8d4b5caf48c1d79252340e1750e160ded1e (diff)
Mark help(), usage(), and grammar() with _X_NORETURN _X_COLD
Resolves gcc -Wsuggest-attribute=noreturn warning Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xprop.c8
1 files 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");