commit | 890de986ce99079877f3c7202db5e0405309ff60 | [log] [tgz] |
---|---|---|
author | Pau Espin Pedrol <pespin@sysmocom.de> | Thu Jul 15 14:34:35 2021 +0200 |
committer | Pau Espin Pedrol <pespin@sysmocom.de> | Thu Jul 15 14:39:39 2021 +0200 |
tree | 024aef5f2af9d9ed3e8f7b5c92580779aa150a11 | |
parent | 4f67a9bf4610c9e948f0d81f3b039f36675180a3 [diff] |
Make gcc 11.1.0 false positivies happy After my system's gcc was upgraded, I get false positivies like the one below: """ /git/osmo-pcu/src/gprs_bssgp_pcu.c: In function ‘ns_configure_nse’: /git/osmo-pcu/src/gprs_bssgp_pcu.c:1103:58: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 2 [-Werror=format-truncation=] 1103 | snprintf(name, sizeof(name), "pcu%d", i); | ^~ /git/osmo-pcu/src/gprs_bssgp_pcu.c:1103:54: note: directive argument in the range [-2147483648, 1] 1103 | snprintf(name, sizeof(name), "pcu%d", i); | ^~~~~~~ /git/osmo-pcu/src/gprs_bssgp_pcu.c:1103:25: note: ‘snprintf’ output between 5 and 15 bytes into a destination of size 5 1103 | snprintf(name, sizeof(name), "pcu%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ In this case, i can't never take a value with more than 1 digit, but gcc seems to be unable to see that. Let's increase the buffer size a few bytes to make gcc happy, and make the variable unsigned since it never will get negative values. Next change is also a false positive, since variables are always initialized beforehand in the cod epaths where they are used: """ /git/osmo-pcu/src/bts.cpp: In function ‘int bts_rcv_rach(gprs_rlcmac_bts*, const rach_ind_params*)’: /git/osmo-pcu/src/bts.cpp:859:25: error: ‘ts_no’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 859 | uint8_t trx_no, ts_no; | ^~~~~ /git/osmo-pcu/src/bts.cpp:859:17: error: ‘trx_no’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 859 | uint8_t trx_no, ts_no; | ^~~~~~ """ Change-Id: I1362a335a0c761bde367dbc779de4afa88f13584
This repository contains a C/C++-language implementation of a GPRS Packet Control Unit, as specified by ETSI/3GPP. It is part of the Osmocom Open Source Mobile Communications project.
The Packet Control Unit is terminating the Layer 2 (RLC/MAC) of the GPRS radio interface and adapting it to the Gb Interface (BSSGP+NS Protocol) towards the SGSN.
The PCU interfaces with the physical layer of the radio interface. OsmoPCU is typically used co-located with the BTS, specifically OsmoBTS. For legacy BTSs that run proprietary sotware without an interface to OsmoPCU, you may also co-locate it with the BSC, specifically OsmoBSC
The official homepage of the project is https://osmocom.org/projects/osmopcu/wiki/OsmoPCU
You can clone from the official osmo-pcu.git repository using
git clone git://git.osmocom.org/osmo-pcu.git
There is a cgit interface at http://git.osmocom.org/osmo-pcu/
We provide a user manual as well as a vty reference manual
Please note that a lot of the PCU configuration actually happens inside the BSC, which passes this configuration via A-bis OML to the BTS, which then in turn passes it via the PCU socket into OsmoPCU.
Discussions related to osmo-pcu are happening on the osmocom-net-gprs@lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive.
Please observe the Osmocom Mailing List Rules when posting.
Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
We us a gerrit based patch submission/review process for managing contributions. Please see https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details
The current patch queue for osmo-pcu can be seen at https://gerrit.osmocom.org/#/q/project:osmo-pcu+status:open