diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-30 10:14:21 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-30 10:14:21 -0700 |
commit | 65ab3ab1976c9e1e2642dd2e79316ff4129d8bc9 (patch) | |
tree | 10f77d9be420c338718c0e0ccaf17f7f4d966c56 /asm/preproc.c | |
parent | f21b2ba8f3772eb7d1207c214a181516b9d1f4e4 (diff) | |
download | nasm-65ab3ab1976c9e1e2642dd2e79316ff4129d8bc9.tar.gz |
clang: mark inline functions unused and add warning options
clang, unlike gcc, will warn on inline functions which are
unused. This can happen if a function is either intended to be used in
the future, or it is only used under certain config options. Mark
those functions with the "unused" attribute; not only does it quiet
the warning, but it also documents it for the user.
Shuffle around the warning options in configure and add a few more
that are specific to clang.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'asm/preproc.c')
-rw-r--r-- | asm/preproc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/asm/preproc.c b/asm/preproc.c index a2c57883..14ca17d3 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -345,7 +345,8 @@ static inline bool tok_text_match(const struct Token *a, const struct Token *b) return a->len == b->len && !memcmp(tok_text(a), tok_text(b), a->len); } -static inline bool tok_match(const struct Token *a, const struct Token *b) +static inline unused bool +tok_match(const struct Token *a, const struct Token *b) { return a->type == b->type && tok_text_match(a, b); } @@ -763,7 +764,8 @@ static const char *unquote_token_cstr(Token *t) * TOK_STRING tokens. */ static Token *quote_any_token(Token *t); -static inline Token *quote_token(Token *t) +static inline unused +Token *quote_token(Token *t) { if (likely(!tok_is(t, TOK_INTERNAL_STRING))) return t; |