rtl8812au-ct: Ignore address errors
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 19 Dec 2022 00:40:04 +0000 (01:40 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 8 Jan 2023 23:23:22 +0000 (00:23 +0100)
GCC 12.2.0 shows these error messages:
````
rtl8812au-ct-2021-11-07-39df5596/core/rtw_sta_mgt.c: In function 'rtw_mfree_stainfo':
rtl8812au-ct-2021-11-07-39df5596/core/rtw_sta_mgt.c:210:24: error: the comparison will always evaluate as 'true' for the address of 'lock' will never be NULL [-Werror=address]
  210 |         if(&psta->lock != NULL)
      |                        ^~
In file included from rtl8812au-ct-2021-11-07-39df5596/include/drv_types.h:109,
                 from rtl8812au-ct-2021-11-07-39df5596/core/rtw_sta_mgt.c:22:
rtl8812au-ct-2021-11-07-39df5596/include/sta_info.h:95:17: note: 'lock' declared here
   95 |         _lock   lock;
      |                 ^~~~
````

````
  CC [M]  rtl8812au-ct-2021-11-07-39df5596/os_dep/linux/ioctl_cfg80211.o
rtl8812au-ct-2021-11-07-39df5596/os_dep/linux/ioctl_cfg80211.c: In function 'cfg80211_rtw_scan':
rtl8812au-ct-2021-11-07-39df5596/os_dep/linux/ioctl_cfg80211.c:2176:32: warning: the comparison will always evaluate as 'true' for the address of 'ssid' will never be NULL [-Waddress]
 2176 |                 if(ssids->ssid != NULL
      |                                ^~
In file included from rtl8812au-ct-2021-11-07-39df5596/include/osdep_service_linux.h:88,
                 from rtl8812au-ct-2021-11-07-39df5596/include/osdep_service.h:41,
                 from rtl8812au-ct-2021-11-07-39df5596/include/drv_types.h:32,
                 from rtl8812au-ct-2021-11-07-39df5596/os_dep/linux/ioctl_cfg80211.c:22:
/home/hauke/openwrt/openwrt/staging_dir/target-mips_24kc_musl/usr/include/mac80211/net/cfg80211.h:2364:12: note: 'ssid' declared here
 2364 |         u8 ssid[IEEE80211_MAX_SSID_LEN];
      |            ^~~~
````

````
  CC [M]  rtl8812au-ct-2021-11-07-39df5596/hal/OUTSRC/phydm_debug.o
rtl8812au-ct-2021-11-07-39df5596/hal/OUTSRC/phydm_debug.c: In function 'phydm_cmd_parser':
rtl8812au-ct-2021-11-07-39df5596/hal/OUTSRC/phydm_debug.c:873:28: warning: the comparison will always evaluate as 'true' for the pointer operand in 'input + ((sizetype)i + 1) * 16' must not be NULL [-Waddress]
  873 |                         if(input[i+1]) {
      |                            ^~~~~
rtl8812au-ct-2021-11-07-39df5596/hal/OUTSRC/phydm_debug.c:894:28: warning: the comparison will always evaluate as 'true' for the pointer operand in 'input + ((sizetype)i + 1) * 16' must not be NULL [-Waddress]
  894 |                         if(input[i+1]) {
      |                            ^~~~~
````

This one was only seen on the rockchip/armv8 target:
````
  CC [M]  rtl8812au-ct-2021-11-07-39df5596/core/rtw_br_ext.o
In function '__nat25_add_pppoe_tag',
    inlined from 'nat25_db_handle' at rtl8812au-ct-2021-11-07-39df5596/core/rtw_br_ext.c:909:10:
rtl8812au-ct-2021-11-07-39df5596/core/rtw_br_ext.c:118:9: error: 'memcpy' reading between 2052 and 9220 bytes from a region of size 40 [-Werror=stringop-overread]
  118 |         memcpy((unsigned char *)ph->tag, tag, data_len);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl8812au-ct-2021-11-07-39df5596/core/rtw_br_ext.c: In function 'nat25_db_handle':
rtl8812au-ct-2021-11-07-39df5596/core/rtw_br_ext.c:878:63: note: source object 'tag_buf' of size 40
  878 |                                                 unsigned char tag_buf[40];
      |                                                               ^~~~~~~
````

Most of them are looking like real errors to me, but some fixes need a
deeper understanding of the driver and probably bigger changes to the driver.

Ignore these error messages for now. It would be nice if someone would
fix them.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/rtl8812au-ct/Makefile

index c8dd417067304ebca6fd7ad0d9adf42aa01684f7..be1acabf28778fb0532585ed657e9f711de829bc 100644 (file)
@@ -39,7 +39,9 @@ NOSTDINC_FLAGS := \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
        -I$(STAGING_DIR)/usr/include/mac80211 \
        -I$(STAGING_DIR)/usr/include/mac80211/uapi \
-       -include backport/backport.h
+       -include backport/backport.h \
+       -Wno-error=address \
+       -Wno-error=stringop-overread
 
 NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT