Skip to content

fix compiler warnings with clang

Thomas Haller netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 4 repliesIn review
  2. v18 patches 10 repliesSuperseded

Changes to v1 from the cover letter

- replace patches
"src: use "%zx" format instead of "%Zx""
"utils: add _NFT_PRAGMA_WARNING_DISABLE()/_NFT_PRAGMA_WARNING_REENABLE helpers" "datatype: suppress "-Wformat-nonliteral" warning in integer_type_print()"
with
"include: drop "format" attribute from nft_gmp_print()"
which is the better solution.
- let SNPRINTF_BUFFER_SIZE() not assert against truncation. Instead, the
callers handle it.
- add bugfix "evaluate: fix check for truncation in stmt_evaluate_log_prefix()"
- add minor patch "evaluate: don't needlessly clear full string buffer in stmt_evaluate_log_prefix()"

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8netlink: avoid "-Wenum-conversion" warning in dtype_map_from_kernel()src/netlink.c+1 -10 replies
2/8netlink: avoid "-Wenum-conversion" warning in parser_bison.ysrc/parser_bison.y+2 -20 replies
3/8datatype: avoid cast-align warning with struct sockaddr result from getaddrinfo()src/datatype.c+11 -30 replies
4/8evaluate: fix check for truncation in stmt_evaluate_log_prefix()src/evaluate.c+1 -10 replies
5/8src: rework SNPRINTF_BUFFER_SIZE() and handle truncationinclude/utils.h src/evaluate.c src/meta.c+37 -170 replies
6/8evaluate: don't needlessly clear full string buffer in stmt_evaluate_log_prefix()src/evaluate.c+4 -12 replies
7/8src: suppress "-Wunused-but-set-variable" warning with "parser_bison.c"src/Makefile.am+1 -00 replies
8/8include: drop "format" attribute from nft_gmp_print()include/nftables.h+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH nft v2 0/8] fix compiler warnings with clang

Building with clang caused some compiler warnings. Fix, suppress or work around them.

Changes to v1:
- replace patches
"src: use "%zx" format instead of "%Zx""
"utils: add _NFT_PRAGMA_WARNING_DISABLE()/_NFT_PRAGMA_WARNING_REENABLE helpers" "datatype: suppress "-Wformat-nonliteral" warning in integer_type_print()"
with
"include: drop "format" attribute from nft_gmp_print()"
which is the better solution.
- let SNPRINTF_BUFFER_SIZE() not assert against truncation. Instead, the
callers handle it.
- add bugfix "evaluate: fix check for truncation in stmt_evaluate_log_prefix()"
- add minor patch "evaluate: don't needlessly clear full string buffer in stmt_evaluate_log_prefix()"

Thomas Haller (8):
netlink: avoid "-Wenum-conversion" warning in dtype_map_from_kernel()
netlink: avoid "-Wenum-conversion" warning in parser_bison.y
datatype: avoid cast-align warning with struct sockaddr result from
getaddrinfo()
evaluate: fix check for truncation in stmt_evaluate_log_prefix()
src: rework SNPRINTF_BUFFER_SIZE() and handle truncation
evaluate: don't needlessly clear full string buffer in
stmt_evaluate_log_prefix()
src: suppress "-Wunused-but-set-variable" warning with
"parser_bison.c"
include: drop "format" attribute from nft_gmp_print()

 include/nftables.h |  3 +--
 include/utils.h    | 35 ++++++++++++++++++++++++++---------
 src/Makefile.am    |  1 +
 src/datatype.c     | 14 +++++++++++---
 src/evaluate.c     | 15 ++++++++++-----
 src/meta.c         | 11 ++++++-----
 src/netlink.c      |  2 +-
 src/parser_bison.y |  4 ++--
 8 files changed, 58 insertions(+), 27 deletions(-)
Signature · 1 line
2.41.0