Project

General

Profile

Actions

Bug #4462

closed

Fix osmo-iuh compilation warnings

Added by pespin about 4 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
03/20/2020
Due date:
% Done:

100%

Spec Reference:

Description

Today I saw a few new compilation warnings introduced recently (or discovered by new gcc version):

/osmo-iuh/src/hnbap_common.c:84:2: warning: enumeration value ‘Cause_PR_NOTHING’ not handled in switch [-Wswitch]
   84 |  switch (cause->present) {
/osmo-iuh/src/hnbgw_hnbap.c: In function ‘hnbgw_rx_hnb_register_req’:
/osmo-iuh/src/hnbgw_hnbap.c:434:2: warning: ‘gsm48_mcc_mnc_from_bcd’ is deprecated: Use osmo_plmn_from_bcd() instead, to not lose leading zeros in the MNC [-Wdeprecated-declarations]
  434 |  gsm48_mcc_mnc_from_bcd(ies.plmNidentity.buf, &ctx->id.mcc, &ctx->id.mnc);
../include/osmocom/ranap/ranap_ies_defs.h:514: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT" redefined
  514 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT     (1 << 2)
      |
../include/osmocom/ranap/ranap_ies_defs.h:512: note: this is the location of the previous definition
  512 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT     (1 << 0)
      |
../include/osmocom/ranap/ranap_ies_defs.h:515: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT" redefined
  515 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT                          (1 << 3)
      |
../include/osmocom/ranap/ranap_ies_defs.h:513: note: this is the location of the previous definition
  513 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT                          (1 << 1)
      |
In file included from /osmo-iuh/include/osmocom/ranap/ranap_common.h:592,
                 from /osmo-iuh/src/ranap_common.c:26:
../include/osmocom/ranap/ranap_ies_defs.h:278: warning: "ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT" redefined
  278 | #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT                   (1 << 1)
      |
../include/osmocom/ranap/ranap_ies_defs.h:277: note: this is the location of the previous definition
  277 | #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT                   (1 << 0)
      |
../include/osmocom/ranap/ranap_ies_defs.h:514: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT" redefined
  514 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT     (1 << 2)
      |
../include/osmocom/ranap/ranap_ies_defs.h:512: note: this is the location of the previous definition
  512 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT     (1 << 0)
      |
../include/osmocom/ranap/ranap_ies_defs.h:515: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT" redefined
  515 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT                          (1 << 3)
      |
../include/osmocom/ranap/ranap_ies_defs.h:513: note: this is the location of the previous definition
  513 | #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT                          (1 << 1)


Related issues

Blocks OsmoHNodeB - Bug #5290: Not building with --enable-werror in contrib/jenkins.shResolvedosmith11/04/2021

Actions
Actions #1

Updated by osmith over 2 years ago

One more new type of warning:

../../include/osmocom/hnbap/HNBAP_CriticalityDiagnostics-IE-List.h:29:23: error: ‘struct HNBAP_CriticalityDiagnostics_IE_List__Member’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
   29 |  A_SEQUENCE_OF(struct HNBAP_CriticalityDiagnostics_IE_List__Member {
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Unfortunately for this warning, there is no -W option for gcc to e.g. have -Werror and -Wno-error=... in order to just not error on this one warning, I've checked the gcc source.

This could be fixed by changing the asn1c source, but if we decide to do that, it probably makes sense to do #2435 first.

Actions #2

Updated by osmith over 2 years ago

  • Blocks Bug #5290: Not building with --enable-werror in contrib/jenkins.sh added
Actions #3

Updated by osmith over 1 year ago

  • Status changed from New to In Progress
  • Assignee changed from pespin to osmith
  • % Done changed from 0 to 30

I've started to fix the errors. Patches so far: https://gerrit.osmocom.org/q/topic:osmo-iuh-werror

Actions #4

Updated by osmith over 1 year ago

  • % Done changed from 30 to 90

patches updated - with those I'm now able to build osmo-iuh and osmo-hnodeb with --enable-werror.

Actions #5

Updated by osmith over 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)