[PATCH 3/3] android/client: Fix compilation with GCC 8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  CC       android/client/android_haltest-if-gatt.o
android/client/if-gatt.c: In function ‘multi_adv_set_inst_data_p’:
android/client/if-gatt.c:2034:7: error: ‘set_scan_rsp’ may be used
      uninitialized in this function [-Werror=maybe-uninitialized]
  EXEC(if_gatt->client->multi_adv_set_inst_data, client_if, set_scan_rsp,
       ^~~~~~~
android/client/if-gatt.c:2034:7: error: ‘include_name’ may be used
         uninitialized in this function [-Werror=maybe-uninitialized]
android/client/if-gatt.c:2034:7: error: ‘include_txpower’ may be used
         uninitialized in this function [-Werror=maybe-uninitialized]
android/client/if-gatt.c: In function ‘set_adv_data_p’:
android/client/if-gatt.c:1859:7: error: ‘set_scan_rsp’ may be used
         uninitialized in this function [-Werror=maybe-uninitialized]
  EXEC(if_gatt->client->set_adv_data, client_if, set_scan_rsp,
       ^~~~~~~
android/client/if-gatt.c:1859:7: error: ‘include_name’ may be used
         uninitialized in this function [-Werror=maybe-uninitialized]
android/client/if-gatt.c:1859:7: error: ‘include_txpower’ may be used
         uninitialized in this function [-Werror=maybe-uninitialized]
cc1: all warnings being treated as errors
make[1]: *** [Makefile:6431: android/client/android_haltest-if-gatt.o] Error 1
make: *** [Makefile:3262: all] Error 2
---
 android/client/if-gatt.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
index 35267832f..ed14f92c4 100644
--- a/android/client/if-gatt.c
+++ b/android/client/if-gatt.c
@@ -1825,8 +1825,9 @@ static void set_adv_data_c(int argc, const char **argv,
 static void set_adv_data_p(int argc, const char **argv)
 {
 	int client_if;
-	bool set_scan_rsp;
-	bool include_name, include_txpower;
+	bool set_scan_rsp = false;
+	bool include_name = false;
+	bool include_txpower = false;
 	int min_interval, max_interval;
 	int appearance;
 	uint16_t manufacturer_len;
@@ -2003,8 +2004,9 @@ static void multi_adv_set_inst_data_c(int argc, const char **argv,
 static void multi_adv_set_inst_data_p(int argc, const char **argv)
 {
 	int client_if;
-	bool set_scan_rsp;
-	bool include_name, include_txpower;
+	bool set_scan_rsp = false;
+	bool include_name = false;
+	bool include_txpower = false;
 	int appearance;
 	uint16_t manufacturer_len;
 	uint8_t manufacturer_data[100];
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux