Skip to content

added range checks in response to compiler overflow warnings - #1522

Open
jgiovatto wants to merge 1 commit into
srsran:masterfrom
jgiovatto:feature/fedora_43_build
Open

added range checks in response to compiler overflow warnings#1522
jgiovatto wants to merge 1 commit into
srsran:masterfrom
jgiovatto:feature/fedora_43_build

Conversation

@jgiovatto

Copy link
Copy Markdown
Contributor

Added range checks in response to compiler errors encountered when building on Fedora 43, gcc version 15.2.1 20260123 (Red Hat 15.2.1-7) (GCC)

srsRAN_4G_jgiovatto/lib/src/phy/fec/block/test/block_test.c:79:11: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
79 | tx[i] = (uint8_t)srsran_random_uniform_int_dist(random_gen, 0, 1);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
srsRAN_4G_jgiovatto/lib/src/phy/fec/block/test/block_test.c:71:18: note: at offset 11 into destination object ‘tx’ of size 11
71 | uint8_t tx[SRSRAN_FEC_BLOCK_MAX_NOF_BITS] = {};

srsRAN_4G_jgiovatto/lib/src/phy/phch/test/pusch_test.c: In function ‘main’:
srsRAN_4G_jgiovatto/lib/src/phy/phch/test/pusch_test.c:305:42: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]

305 | uci_data_tx.value.ack.ack_value[a] = (uint8_t)srsran_random_uniform_int_dist(random_h, 0, 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from srsRAN_4G_jgiovatto/lib/include/srsran/phy/phch/pucch_cfg.h:27,
from srsRAN_4G_jgiovatto/lib/include/srsran/phy/ch_estimation/refsignal_ul.h:35,
from srsRAN_4G_jgiovatto/lib/include/srsran/phy/ch_estimation/chest_ul.h:43,
from srsRAN_4G_jgiovatto/lib/include/srsran/srsran.h:51,
from srsRAN_4G_jgiovatto/lib/src/phy/phch/test/pusch_test.c:22:
srsRAN_4G_jgiovatto/lib/include/srsran/phy/phch/uci_cfg.h:32:11: note: at offset 10 into destination object ‘ack_value’ of size 10
32 | uint8_t ack_value[SRSRAN_UCI_MAX_ACK_BITS];

Note: Errors in ans1_utils.h were previously addressed in the ubuntu 22.04 builds branch. The though here is to check the capacity of the "other" object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant