Change in libosmo-sccp[master]: sccp.c: Fix gcc-8.2 -Werror=maybe-uninitialized

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Jan 20 14:12:32 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/12645


Change subject: sccp.c: Fix gcc-8.2 -Werror=maybe-uninitialized
......................................................................

sccp.c: Fix gcc-8.2 -Werror=maybe-uninitialized

This fixes the following compiler warning when using -Werror on gcc-8.2:

sccp.c: In function ‘sccp_system_incoming_ctx’:
sccp.c:1039:10: error: ‘result.destination_local_reference’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
       && memcmp(&conn->source_local_reference,
          result.destination_local_reference,
          sizeof(conn->source_local_reference)) == 0
sccp.c:1030:27: note: ‘result.destination_local_reference’ was declared here
  struct sccp_parse_result result;
                           ^~~~~~

Change-Id: Ied41f7c8ddaa5f616dd6556079a54d8d70274490
---
M src/sccp.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/45/12645/1

diff --git a/src/sccp.c b/src/sccp.c
index 8c3641c..ec0f3b7 100644
--- a/src/sccp.c
+++ b/src/sccp.c
@@ -1027,7 +1027,7 @@
 /* Handle the release confirmed */
 static int _sccp_handle_connection_release_complete(struct msgb *msgb)
 {
-	struct sccp_parse_result result;
+	struct sccp_parse_result result = {};
 	struct sccp_connection *conn;
 
 	if (_sccp_parse_connection_release_complete(msgb, &result) != 0)

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied41f7c8ddaa5f616dd6556079a54d8d70274490
Gerrit-Change-Number: 12645
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190120/b9b1c64d/attachment.htm>


More information about the gerrit-log mailing list