Change in openbsc[master]: gsm0408_dispatch: Fix uninitialized var warning

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
Fri Jun 15 14:46:17 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9640


Change subject: gsm0408_dispatch: Fix uninitialized var warning
......................................................................

gsm0408_dispatch: Fix uninitialized var warning

Got this warning since my upgrade to gcc 8.1.0. Quick check tells me
it's probably a false positive, but let's fix the warning anyway.

openbsc/openbsc/src/libmsc/gsm_04_08.c: In function ‘gsm0408_dispatch’:
openbsc/openbsc/src/libmsc/gsm_04_08.c:1260:5: error: ‘res_len’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (res_len != 4) {
     ^
openbsc/openbsc/src/libmsc/gsm_04_08.c:1223:10: note: ‘res_len’ was declared here
  uint8_t res_len;
          ^~~~~~~

Change-Id: Ifa45f73645c9ab022c18a012abe03214aa21526f
---
M openbsc/src/libmsc/gsm_04_08.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/9640/1

diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 006de7f..09e35cc 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1220,7 +1220,7 @@
 {
 	struct gsm_network *net = conn->network;
 	uint8_t res[16];
-	uint8_t res_len;
+	uint8_t res_len = 0;
 	int rc;
 	bool is_r99;
 

-- 
To view, visit https://gerrit.osmocom.org/9640
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa45f73645c9ab022c18a012abe03214aa21526f
Gerrit-Change-Number: 9640
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180615/053621ee/attachment.htm>


More information about the gerrit-log mailing list