summaryrefslogtreecommitdiffstats
path: root/include/expression.h
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2025-10-17 10:38:25 +0200
committerFlorian Westphal <fw@strlen.de>2025-10-23 14:53:50 +0200
commitbc330914780345616edde25329e3c866ec279b42 (patch)
tree52a73d4f3d886f13c86fff60e14516ca2c2b97be /include/expression.h
parent95482c8c809922aa870099e81c65568330b35b42 (diff)
src: fix fmt string warnings
for some reason several functions had a __gmp_fmtstring annotation, but that was an empty macro. After fixing it up, we get several new warnings: In file included from src/datatype.c:28: src/datatype.c:174:24: note: in expansion of macro 'error' 174 | return error(&sym->location, | ^~~~~ src/datatype.c:405:24: note: in expansion of macro 'error' 405 | return error(&sym->location, "Could not parse %s; did you mean `%s'?", | ^~~~~ Fmt string says '%s', but unqailified void *, add 'const char *' cast, it is safe in both cases. In file included from src/evaluate.c:29: src/evaluate.c: In function 'byteorder_conversion': src/evaluate.c:232:35: warning: format '%s' expects a matching 'char *' argument [-Wformat=] 232 | "Byteorder mismatch: %s expected %s, %s got %s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Actual bug, fmt string has one '%s' too many, remove it. All other warnings were due to '%u' instead of '%lu' / '%zu'. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include/expression.h')
-rw-r--r--include/expression.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/expression.h b/include/expression.h
index e73ad90e..a960f8cb 100644
--- a/include/expression.h
+++ b/include/expression.h
@@ -441,7 +441,7 @@ extern void expr_set_type(struct expr *expr, const struct datatype *dtype,
struct eval_ctx;
extern int expr_binary_error(struct list_head *msgs,
const struct expr *e1, const struct expr *e2,
- const char *fmt, ...) __gmp_fmtstring(4, 5);
+ const char *fmt, ...) __fmtstring(4, 5);
#define expr_error(msgs, expr, fmt, args...) \
expr_binary_error(msgs, expr, NULL, fmt, ## args)