diff options
| author | Florian Westphal <fw@strlen.de> | 2025-10-17 10:38:25 +0200 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2025-10-23 14:53:50 +0200 |
| commit | bc330914780345616edde25329e3c866ec279b42 (patch) | |
| tree | 52a73d4f3d886f13c86fff60e14516ca2c2b97be /include/utils.h | |
| parent | 95482c8c809922aa870099e81c65568330b35b42 (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/utils.h')
| -rw-r--r-- | include/utils.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/include/utils.h b/include/utils.h index e18fabec..474c7595 100644 --- a/include/utils.h +++ b/include/utils.h @@ -27,11 +27,6 @@ #endif #define __fmtstring(x, y) __attribute__((format(printf, x, y))) -#if 0 -#define __gmp_fmtstring(x, y) __fmtstring(x, y) -#else -#define __gmp_fmtstring(x, y) -#endif #define __must_check __attribute__((warn_unused_result)) #define __noreturn __attribute__((__noreturn__)) |
