[PATCH] osmo-msc[master]: smpp: Fix compilation 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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Aug 24 17:41:12 UTC 2017


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

smpp: Fix compilation warning

I already stumbled into 2 compilation environments which had Werror
enabled for -Wmaybe-uninitialized and the build failed, so let's
workaround this warning.

| smpp_openbsc.c: In function 'handle_smpp_submit':
| smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|    memcpy(sms->user_data, sms_msg, sms_msg_len);
|          ^
| smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here
|   unsigned int sms_msg_len;
|                ^
| cc1: some warnings being treated as errors

Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146
---
M src/libmsc/smpp_openbsc.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/68/3668/1

diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c
index c2f2f3b..ec14898 100644
--- a/src/libmsc/smpp_openbsc.c
+++ b/src/libmsc/smpp_openbsc.c
@@ -94,11 +94,11 @@
 			 const struct submit_sm_t *submit)
 {
 	const uint8_t *sms_msg = NULL;
+	unsigned int sms_msg_len = 0;
 	struct vlr_subscr *dest;
 	uint16_t msg_ref = 0;
 	struct gsm_sms *sms;
 	struct tlv_t *t;
-	unsigned int sms_msg_len;
 	int mode;
 
 	dest = subscr_by_dst(net, submit->dest_addr_npi,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list