diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-22 13:09:18 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-22 13:09:18 -0700 |
commit | ab1dce3cee49f0c497b158a2a2dd3412d531e154 (patch) | |
tree | f0892e348403a5cc0949844959c70e3a80e077f5 | |
parent | 41975db12f73a6f23d111c3e31b4f3a14ea88b68 (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.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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) |