summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-22 13:09:18 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-22 13:09:18 -0700
commitab1dce3cee49f0c497b158a2a2dd3412d531e154 (patch)
treef0892e348403a5cc0949844959c70e3a80e077f5
parent41975db12f73a6f23d111c3e31b4f3a14ea88b68 (diff)
usage: add cold & noreturn attributes to function
As suggested by clang: xlsatoms.c:56:1: warning: function 'usage' could be declared with attribute 'noreturn' [-Wmissing-noreturn] { ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xlsatoms.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/xlsatoms.c b/xlsatoms.c
index 6c7f4b5..1dbe1e9 100644
--- a/xlsatoms.c
+++ b/xlsatoms.c
@@ -51,7 +51,17 @@ static void do_range ( xcb_connection_t *c, const char *format, char *range );
static void list_atoms ( xcb_connection_t *c, const char *format, int mask,
xcb_atom_t low, xcb_atom_t high );
-static void
+#ifndef __has_attribute
+# define __has_attribute(x) 0 /* Compatibility with older compilers. */
+#endif
+
+static void
+#if __has_attribute(__cold__)
+__attribute__((__cold__))
+#endif
+#if __has_attribute(noreturn)
+__attribute__((noreturn))
+#endif
usage(const char *errmsg)
{
if (errmsg != NULL)