wpa-supplicant fails to build with GCC 10

Andrej Shadura andrew.shadura at collabora.co.uk
Sun Nov 15 09:23:53 EST 2020


Hi,

GCC 10 has made -Werror=array-bounds the default, leading to this:

> cc -c -o /<<PKGBUILDDIR>>/build/wpa_supplicant/src/fst/fst.o -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -MMD -Wall -Wdate-time -D_FORTIFY_SOURCE=2  -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/src/utils -Werror -DEAPOL_TEST -DCONFIG_HT_OVERRIDES -DCONFIG_VHT_OVERRIDES -DCONFIG_BACKEND_FILE -DCONFIG_IEEE80211R -DCONFIG_SAE -DCONFIG_DPP -DCONFIG_OWE -DCONFIG_TDLS -DCONFIG_PMKSA_CACHE_EXTERNAL -DCONFIG_IBSS_RSN -DCONFIG_NO_VLAN -DCONFIG_P2P -DCONFIG_WIFI_DISPLAY -DCONFIG_HS20 -DCONFIG_INTERWORKING -DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_MACSEC_LINUX -DCONFIG_DRIVER_NL80211 -DCONFIG_DRIVER_NL80211_QCA -DCONFIG_DRIVER_NONE -I/usr/include/libnl3 -DCONFIG_LIBNL3_ROUTE -DCONFIG_DRIVER_WEXT -DCONFIG_WIRELESS_EXTENSION  -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_OTP -DEAP_SIM -DEAP_LEAP -DEAP_PSK -DEAP_AKA -DEAP_AKA_PRIME -DEAP_FAST -DEAP_PAX -DEAP_SAKE -DEAP_GPSK -DEAP_GPSK_SHA256 -DEAP_PWD -DEAP_EKE -DCONFIG_WPS -DEAP_WSC -DCONFIG_WPS_NFC -DCONFIG_WPS_OOB -DCONFIG_WPS_ER -DCONFIG_WPS_UPNP -DCONFIG_WPS_REG_DISABLE_OPEN -DEAP_IKEV2 -DEAP_TNC -DCONFIG_MACSEC -DIEEE8021X_EAPOL -DCONFIG_AP -DCONFIG_NO_RADIUS -DCONFIG_NO_ACCOUNTING -DCONFIG_NO_VLAN -DEAP_SERVER -DEAP_SERVER_IDENTITY -DCONFIG_IEEE80211AC -DNEED_AP_MLME -DEAP_SERVER_WSC -DCONFIG_NO_RADIUS -DCONFIG_ACS -DPCSC_FUNCS -I/usr/include/PCSC -DPKCS12_FUNCS -DCONFIG_SMARTCARD -DCONFIG_TLSV11 -DCONFIG_TLSV12 -DEAP_TLS_OPENSSL -DTLS_DEFAULT_CIPHERS=\""DEFAULT at SECLEVEL=1"\" -DCONFIG_DES -DCONFIG_SHA256 -DCONFIG_HMAC_SHA256_KDF -DCONFIG_HMAC_SHA384_KDF -DCONFIG_HMAC_SHA512_KDF -DCONFIG_SHA384 -DCONFIG_SHA512 -DALL_DH_GROUPS -DCONFIG_ECC -DCONFIG_GETRANDOM -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_CTRL_IFACE_DBUS_NEW -DCONFIG_CTRL_IFACE_DBUS_INTRO -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -DCONFIG_SME -DCONFIG_DEBUG_SYSLOG -DLOG_HOSTAPD="LOG_DAEMON" -DCONFIG_DEBUG_LINUX_TRACING -DCONFIG_DEBUG_FILE -DCONFIG_DELAYED_MIC_ERROR_REPORT -DCONFIG_BGSCAN_SIMPLE -DCONFIG_BGSCAN_LEARN -DCONFIG_BGSCAN -DCONFIG_AUTOSCAN_EXPONENTIAL -DCONFIG_AUTOSCAN_PERIODIC -DCONFIG_AUTOSCAN -DCONFIG_GAS_SERVER -DCONFIG_GAS -DCONFIG_OFFCHANNEL -DCONFIG_JSON -DCONFIG_FST ../src/fst/fst.c
> In file included from /<<PKGBUILDDIR>>/src/fst/fst_iface.h:15,
>                  from /<<PKGBUILDDIR>>/src/fst/fst_internal.h:16,
>                  from ../src/fst/fst.c:14:
> ../src/fst/fst.c: In function ‘fst_ctrl_iface_notify_peer_state_change’:
> /<<PKGBUILDDIR>>/src/utils/list.h:68:3: error: array subscript -4 is outside array bounds of ‘struct dl_list[1]’ [-Werror=array-bounds]
>    68 |  ((type *) ((char *) item - offsetof(type, member)))
>       |  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/utils/list.h:80:23: note: in expansion of macro ‘dl_list_entry’
>    80 |       item && item != dl_list_entry((list), type, member); \
>       |                       ^~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/fst/fst_internal.h:43:3: note: in expansion of macro ‘dl_list_for_each’
>    43 |   dl_list_for_each(__fst_ctrl_h, &fst_global_ctrls_list, \
>       |   ^~~~~~~~~~~~~~~~
> ../src/fst/fst.c:33:2: note: in expansion of macro ‘foreach_fst_ctrl_call’
>    33 |  foreach_fst_ctrl_call(on_event, EVENT_PEER_STATE_CHANGED,
>       |  ^~~~~~~~~~~~~~~~~~~~~
> ../src/fst/fst.c:19:16: note: while referencing ‘fst_global_ctrls_list’
>    19 | struct dl_list fst_global_ctrls_list;
>       |                ^~~~~~~~~~~~~~~~~~~~~
> In file included from /<<PKGBUILDDIR>>/src/fst/fst_iface.h:15,
>                  from /<<PKGBUILDDIR>>/src/fst/fst_internal.h:16,
>                  from ../src/fst/fst.c:14:
> ../src/fst/fst.c: In function ‘fst_attach’:
> /<<PKGBUILDDIR>>/src/utils/list.h:68:3: error: array subscript -3 is outside array bounds of ‘struct dl_list[1]’ [-Werror=array-bounds]
>    68 |  ((type *) ((char *) item - offsetof(type, member)))
>       |  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/utils/list.h:80:23: note: in expansion of macro ‘dl_list_entry’
>    80 |       item && item != dl_list_entry((list), type, member); \
>       |                       ^~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/fst/fst_group.h:60:2: note: in expansion of macro ‘dl_list_for_each’
>    60 |  dl_list_for_each((g), &fst_global_groups_list, \
>       |  ^~~~~~~~~~~~~~~~
> ../src/fst/fst.c:51:2: note: in expansion of macro ‘foreach_fst_group’
>    51 |  foreach_fst_group(g) {
>       |  ^~~~~~~~~~~~~~~~~
> In file included from /<<PKGBUILDDIR>>/src/fst/fst_internal.h:17,
>                  from ../src/fst/fst.c:14:
> /<<PKGBUILDDIR>>/src/fst/fst_group.h:57:23: note: while referencing ‘fst_global_groups_list’
>    57 | extern struct dl_list fst_global_groups_list;
>       |                       ^~~~~~~~~~~~~~~~~~~~~~
> In file included from /<<PKGBUILDDIR>>/src/fst/fst_iface.h:15,
>                  from /<<PKGBUILDDIR>>/src/fst/fst_internal.h:16,
>                  from ../src/fst/fst.c:14:
> /<<PKGBUILDDIR>>/src/utils/list.h:68:3: error: array subscript -4 is outside array bounds of ‘struct dl_list[1]’ [-Werror=array-bounds]
>    68 |  ((type *) ((char *) item - offsetof(type, member)))
>       |  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/utils/list.h:80:23: note: in expansion of macro ‘dl_list_entry’
>    80 |       item && item != dl_list_entry((list), type, member); \
>       |                       ^~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/fst/fst_internal.h:43:3: note: in expansion of macro ‘dl_list_for_each’
>    43 |   dl_list_for_each(__fst_ctrl_h, &fst_global_ctrls_list, \
>       |   ^~~~~~~~~~~~~~~~
> ../src/fst/fst.c:80:2: note: in expansion of macro ‘foreach_fst_ctrl_call’
>    80 |  foreach_fst_ctrl_call(on_iface_added, iface);
>       |  ^~~~~~~~~~~~~~~~~~~~~
> ../src/fst/fst.c:19:16: note: while referencing ‘fst_global_ctrls_list’
>    19 | struct dl_list fst_global_ctrls_list;
>       |                ^~~~~~~~~~~~~~~~~~~~~
> In file included from /<<PKGBUILDDIR>>/src/fst/fst_iface.h:15,
>                  from /<<PKGBUILDDIR>>/src/fst/fst_internal.h:16,
>                  from ../src/fst/fst.c:14:
> ../src/fst/fst.c: In function ‘fst_detach’:
> /<<PKGBUILDDIR>>/src/utils/list.h:68:3: error: array subscript -4 is outside array bounds of ‘struct dl_list[1]’ [-Werror=array-bounds]
>    68 |  ((type *) ((char *) item - offsetof(type, member)))
>       |  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/utils/list.h:80:23: note: in expansion of macro ‘dl_list_entry’
>    80 |       item && item != dl_list_entry((list), type, member); \
>       |                       ^~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/fst/fst_internal.h:43:3: note: in expansion of macro ‘dl_list_for_each’
>    43 |   dl_list_for_each(__fst_ctrl_h, &fst_global_ctrls_list, \
>       |   ^~~~~~~~~~~~~~~~
> ../src/fst/fst.c:97:2: note: in expansion of macro ‘foreach_fst_ctrl_call’
>    97 |  foreach_fst_ctrl_call(on_iface_removed, iface);
>       |  ^~~~~~~~~~~~~~~~~~~~~
> ../src/fst/fst.c:19:16: note: while referencing ‘fst_global_ctrls_list’
>    19 | struct dl_list fst_global_ctrls_list;
>       |                ^~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[2]: *** [../src/build.rules:86: /<<PKGBUILDDIR>>/build/wpa_supplicant/src/fst/fst.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[2]: Leaving directory '/<<PKGBUILDDIR>>/wpa_supplicant'

It has previously been reported at the Debian BTS, but I temporarily
silenced it hoping for someone else to notice it too :)

More logs can be found here: https://bugs.debian.org/966350

-- 
Cheers,
  Andrej


More information about the Hostap mailing list