[PATCH] osmo-iuh[master]: compiler warning: asn1tostruct.py: return 0 at end of *_free...

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
Sun Dec 24 23:46:30 UTC 2017


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/5533

to look at the new patch set (#2).

compiler warning: asn1tostruct.py: return 0 at end of *_free_*()

Part of the resulting diff in the generated code:

--- /tmp/hnbap_decoder.c	2017-12-24 17:06:50.983979866 +0100
+++ /tmp/hnbap_decoder.c	2017-12-24 17:07:10.760223354 +0100
@@ -1179,6 +1179,7 @@
     TNLUpdateResponseIEs_t *tnlUpdateResponseIEs) {

     ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Context_ID, &tnlUpdateResponseIEs->context_ID);
+    return 0;
 }

 int hnbap_free_tnlupdaterequesties(
@@ -1187,6 +1188,7 @@
     ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Context_ID, &tnlUpdateRequestIEs->context_ID);
     ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RABList, &tnlUpdateRequestIEs->rabList);
     ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Update_cause, &tnlUpdateRequestIEs->update_cause);
+    return 0;
 }

 int hnbap_free_errorindicationies(
@@ -1197,12 +1199,14 @@
     if ((errorIndicationIEs->presenceMask & ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT)
         == ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT)
         ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_CriticalityDiagnostics, &errorIndicationIEs->criticalityDiagnostics);
+    return 0;
 }

 int hnbap_free_hnbconfigtransferrequesties(
     HNBConfigTransferRequestIEs_t *hnbConfigTransferRequestIEs) {

     ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NeighbourInfoRequestList, &hnbConfigTransferRequestIEs->neighbourInfoRequestList);
+    return 0;
 }

 int hnbap_free_tnlupdatefailureies(

[etc.]

Related: OS#2670
Change-Id: Ieba12c09c33a81da964bf88a858714d922ced8c0
---
M asn1/utils/asn1tostruct.py
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/33/5533/2

diff --git a/asn1/utils/asn1tostruct.py b/asn1/utils/asn1tostruct.py
index 5586e40..0bba9dd 100755
--- a/asn1/utils/asn1tostruct.py
+++ b/asn1/utils/asn1tostruct.py
@@ -389,6 +389,8 @@
         iename = re.sub('id-', '', ie[0])
         ienameunderscore = lowerFirstCamelWord(re.sub('-', '_', iename))
         f.write("    ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_%s, &%s->%s);\n" % (ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienameunderscore))
+
+    f.write("    return 0;\n")
     f.write("}\n\n")
 
 for key in iesDefs:

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ieba12c09c33a81da964bf88a858714d922ced8c0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list