Skip to content

Use C99 flexible array members for the trailing variable-length arrays (-Warray-bounds 22 -> 0) - #44

Open
iav wants to merge 1 commit into
jethome-iot:tune_for_jethubfrom
iav:fix/flex-arrays
Open

Use C99 flexible array members for the trailing variable-length arrays (-Warray-bounds 22 -> 0)#44
iav wants to merge 1 commit into
jethome-iot:tune_for_jethubfrom
iav:fix/flex-arrays

Conversation

@iav

@iav iav commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

ieee80211.h (wpa_ie.data, crypt.key, bcn_ie.buf, ieee_param_ex.data,
info_element.data) and wlan_bssdef.h (NDIS_802_11_VARIABLE_IEs.data)
declared their trailing payloads as [0] / [1]. Since 6.5 the kernel
builds with -fstrict-flex-arrays=3, so only [] is treated as a flexible
array and every index into these members is reported as out of bounds
(clang -Warray-bounds, 22 -> 0). None of the affected types is used with
sizeof(), so no size changes.

gcc + clang builds: no errors, every other class unchanged. Does not
overlap the open PRs.

ieee80211.h (wpa_ie.data, crypt.key, bcn_ie.buf, ieee_param_ex.data,
info_element.data) and wlan_bssdef.h (NDIS_802_11_VARIABLE_IEs.data)
declared their trailing payloads as [0] / [1]. Since 6.5 the kernel
builds with -fstrict-flex-arrays=3, so only [] is treated as a flexible
array and every index into these members is reported as out of bounds
(clang -Warray-bounds, 22). None of the affected types is used with
sizeof(), so no size changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant