netfilter-match-modules: fix implicit-declaration warnings for newer GCC#45
Open
ispyisail wants to merge 1 commit into
Open
netfilter-match-modules: fix implicit-declaration warnings for newer GCC#45ispyisail wants to merge 1 commit into
ispyisail wants to merge 1 commit into
Conversation
Newer GCC toolchains (as used building this OpenWrt 25.12 bump) warn on functions called before they're declared, where older GCC treated this as silently fine. Adds missing forward declarations across the webmon, weburl, and bandwidth modules (both iptables and nftables variants) and their shared regexp.h helper (my_strcspn). Also fixes two real portability issues in the iptables bandwidth userspace tool (libxt_bandwidth.c), currently unused now that Gargoyle builds nftables-only but still worth correcting: - Removed a private `ipany` union duplicating the kernel's own `union xt_bandwidth_ipany` (from linux/netfilter/xt_bandwidth.h) - two separate definitions of the same layout is a latent bug if either one ever changes shape. - Print 64-bit fields via an explicit (long long) cast rather than relying on `%lld` matching whatever the platform's uint64_t/time_t happens to be, which isn't guaranteed and trips -Wformat on stricter toolchains. Reordered a Makefile-generation step in integrate_netfilter_modules.sh so GENERIC_PLATFORM_DIR/PLATFORM_DIR are defined before the kernel-version.mk include that (on this newer OpenWrt base) expects them already set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #43 — base branch is
openwrt-2512(the 25.12 bump), notmaster. Merge #43 first; this rebases cleanly onto master afterward.Applies fixes for implicit-declaration warnings across the netfilter-match-modules webmon, weburl, and bandwidth modules (both iptables and nftables variants) and their shared
regexp.hhelper, plus two real portability fixes in the iptables bandwidth userspace tool (libxt_bandwidth.c) — a duplicatedipanyunion and an unportable%lldformat assumption.The underlying diff was proposed by Michael Gray (of the nftables port of these modules) for a separate GCC/kernel toolchain. Confirmed during review that on this repo's current toolchain the affected code paths only produce warnings, not hard errors (
CONFIG_WERRORisn't set) — so this isn't a build-breaking fix here, but it's a real correctness improvement worth carrying: newer GCC toolchains do turn functions-called-before-declared into a hard error, and the duplicated union / format-string issues are genuine latent bugs.Not otherwise related to the 25.12 bump; stacked only because the affected files were touched by the bump's own nftables fixes and this avoids re-deriving against a moving target.