From c32dc38056e9b2e51a9a2c36084bac97eae2c056 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Thu, 3 Mar 2022 15:16:00 -0500
Subject: [PATCH] GCC2 fixes.

---
 src/ap/hostapd.h                            | 2 +-
 src/common/ieee802_11_common.h              | 2 +-
 src/common/ieee802_11_defs.h                | 6 +++---
 wpa_supplicant/bss.h                        | 2 +-
 wpa_supplicant/wpa_gui-haiku/main_haiku.cpp | 1 +
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index f3ca752..aee5518 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -146,7 +146,7 @@ struct hostapd_sae_commit_queue {
 	struct dl_list list;
 	int rssi;
 	size_t len;
-	u8 msg[];
+	u8 msg[0];
 };
 
 /**
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index 3c57803..0c846dc 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -15,7 +15,7 @@
 struct element {
 	u8 id;
 	u8 datalen;
-	u8 data[];
+	u8 data[0];
 } STRUCT_PACKED;
 
 struct hostapd_hw_modes;
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index d04d2d6..41d157f 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -1001,12 +1001,12 @@ struct ieee80211_mgmt {
 				struct {
 					u8 action;
 					u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
-					u8 variable[]; /* OCI element */
+					u8 variable[0]; /* OCI element */
 				} STRUCT_PACKED sa_query_req;
 				struct {
 					u8 action; /* */
 					u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
-					u8 variable[]; /* OCI element */
+					u8 variable[0]; /* OCI element */
 				} STRUCT_PACKED sa_query_resp;
 				struct {
 					u8 action;
@@ -1067,7 +1067,7 @@ struct ieee80211_mgmt {
 				struct {
 					u8 action; /* 12 */
 					u8 dialog_token;
-					u8 variable[];
+					u8 variable[0];
 				} STRUCT_PACKED coloc_intf_report;
 				struct {
 					u8 action; /* 15 */
diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h
index 4078b9b..11e0b90 100644
--- a/wpa_supplicant/bss.h
+++ b/wpa_supplicant/bss.h
@@ -122,7 +122,7 @@ struct wpa_bss {
 	size_t beacon_ie_len;
 	/* followed by ie_len octets of IEs */
 	/* followed by beacon_ie_len octets of IEs */
-	u8 ies[];
+	u8 ies[0];
 };
 
 static inline const u8 * wpa_bss_ie_ptr(const struct wpa_bss *bss)
diff --git a/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp b/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp
index 3171d89..3776742 100644
--- a/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp
+++ b/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp
@@ -52,6 +52,7 @@ extern "C" {
 #undef B_TRANSLATION_CONTEXT
 #define B_TRANSLATION_CONTEXT "wpa_supplicant"
 
+#undef bool
 
 static const uint32 kMsgJoinTimeout = 'jnto';
 static const char *kWPASupplicantKeyring = "wpa_supplicant";
-- 
2.30.2

