diff options
author | Thomas Haller <thaller@redhat.com> | 2023-08-29 14:53:37 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-08-29 20:03:42 +0200 |
commit | 0ba90cceaf8693a392196112c809302271259758 (patch) | |
tree | c0667affe1d7f21c2a0b31c646e577c8ccda7054 /src/evaluate.c | |
parent | 83d1a6733691d8bbb9ca1b9c195591794074337d (diff) |
include: drop "format" attribute from nft_gmp_print()
nft_gmp_print() passes the format string and arguments to
gmp_vfprintf(). Note that the format string is then interpreted
by gmp, which also understand special specifiers like "%Zx".
Note that with clang we get various compiler warnings:
datatype.c:299:26: error: invalid conversion specifier 'Z' [-Werror,-Wformat-invalid-specifier]
nft_gmp_print(octx, "0x%Zx [invalid type]", expr->value);
~^
gcc doesn't warn, because to gcc 'Z' is a deprecated alias for 'z' and
because the 3rd argument of the attribute((format())) is zero (so gcc
doesn't validate the arguments). But Z specifier in gmp expects a
"mpz_t" value and not a size_t. It's really not the same thing.
The correct solution is not to mark the function to accept a printf format
string.
Fixes: 2535ba7006f2 ('src: get rid of printf')
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
0 files changed, 0 insertions, 0 deletions