[PATCH] libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Sun Jun 18 09:26:41 UTC 2017


Review at  https://gerrit.osmocom.org/2955

abis_test.c: Fix warning appearing on some buggy gcc versions

Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000
---
M tests/abis/abis_test.c
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/2955/1

diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c
index a303c91..cb88b01 100644
--- a/tests/abis/abis_test.c
+++ b/tests/abis/abis_test.c
@@ -122,7 +122,8 @@
 
 static inline void chk_raw(const char *what, const uint8_t *data, uint16_t len)
 {
-	struct abis_nm_sw_desc sw = { 0 };
+	/* = { 0 } triggers a warning in some gcc versions due to a bug: gcc issue #53119 */
+	struct abis_nm_sw_desc sw = { {0} };
 	int res = abis_nm_get_sw_conf(data, len, &sw, 1);
 	uint16_t xlen = abis_nm_get_sw_desc_len(data, len);
 
@@ -144,7 +145,8 @@
 {
 	int res;
 	uint16_t len;
-	struct abis_nm_sw_desc sw = { 0 }, put = {
+	/* = { 0 } triggers a warning in some gcc versions due to a bug: gcc issue #53119 */
+	struct abis_nm_sw_desc sw = { {0} }, put = {
 		.file_id_len = strlen(f_id),
 		.file_version_len = strlen(f_ver),
 	};

-- 
To view, visit https://gerrit.osmocom.org/2955
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list