Two fixes to avoid "-Wstrict-overflow" warnings
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | nft: add NFT_ARRAY_SIZE() helperinclude/ | +2 | 2 replies | |
| 2/3 | nfnl_osf: rework nf_osf_parse_opt() and avoid "-Wstrict-overflow" warningsrc/ | +58 | 7 replies | |
| 3/3 | netlink_linearize: avoid strict-overflow warning in netlink_gen_bitwise()src/ | +3 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH nft 0/3] Two fixes to avoid "-Wstrict-overflow" warnings
The "-Wstrict-overflow=5" warning seems useful, as it's easy to get this wrong. I think C really should have "-fwrapv" behavior, but the reality is that we need to be careful about signed overflow. The warning helps with that, and luckily there are only a few places that require fixes. Note that libparser and mini-gmp.c cannot build with "-Wstrict-overflow=5".
Maybe there are other warnings, as it depends on the optimization level and the compiler. This works for my gcc and -O3.
Thomas Haller (3):
nft: add NFT_ARRAY_SIZE() helper
nfnl_osf: rework nf_osf_parse_opt() and avoid "-Wstrict-overflow"
warning
netlink_linearize: avoid strict-overflow warning in
netlink_gen_bitwise()
include/nft.h | 2 + src/netlink_linearize.c | 7 +-- src/nfnl_osf.c | 128 ++++++++++++++++++---------------------- 3 files changed, 63 insertions(+), 74 deletions(-)
Signature · 1 line
2.41.0