From 6620b8524b06e9bc0c6cb389bf0890d596430e5b Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Mon, 11 Apr 2022 12:10:17 +0800 Subject: [PATCH] mxm_wifiex: avoid the array-bounds build warnings on L5.17 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When build the wifi driver based on L5.17 kernel, we may meet the following build warnings. Add Wno-array-bounds cc-flags to avoid it. /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c: In function ‘woal_host_mlme_disconnect’: /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9127:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds] 9127 | mgmt->frame_control = (__force __le16)IEEE80211_STYPE_DEAUTH; | ^~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’ 9123 | t_u8 frame_buf[26]; | ^~~~~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9128:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds] 9128 | mgmt->duration = 0; | ^~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’ 9123 | t_u8 frame_buf[26]; | ^~~~~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9129:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds] 9129 | mgmt->seq_ctrl = 0; | ^~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’ 9123 | t_u8 frame_buf[26]; | ^~~~~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9130:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds] 9130 | mgmt->u.deauth.reason_code = (__force __le16)reason_code; | ^~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’ 9123 | t_u8 frame_buf[26]; | ^~~~~~~~~ Signed-off-by: Sherry Sun Approved-by: Tian Yang --- mxm_wifiex/wlan_src/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/mxm_wifiex/wlan_src/Makefile b/mxm_wifiex/wlan_src/Makefile index 192e89e..0e2fc62 100644 --- a/mxm_wifiex/wlan_src/Makefile +++ b/mxm_wifiex/wlan_src/Makefile @@ -345,6 +345,7 @@ endif #ccflags-y += -Wmisleading-indentation #ccflags-y += -Wunused-const-variable ccflags-y += -Wno-stringop-truncation +ccflags-y += -Wno-array-bounds ############################################################################# # Make Targets #############################################################################