Commit e04554dc authored by mir's avatar mir

Warnings generated in gcc 13 and tackled in this PR (except const correctness)

    49 /home/mir/workspace/oai_dev/common/utils/T/tracer/to_vcd.c: In function ‘main’:
    50 /home/mir/workspace/oai_dev/common/utils/T/tracer/to_vcd.c:349:30: warning: ‘%s’ directive writing up to 240 bytes into a region of size between 11 and 251 [-Wformat-overflow=]
    51   349 |     sprintf(format, "%c [%s] %s",
    52       |                              ^~
    53 In file included from /usr/include/stdio.h:894,
    54                  from /home/mir/workspace/oai_dev/common/utils/T/tracer/to_vcd.c:1:
    55 In function ‘sprintf’,
    56     inlined from ‘main’ at /home/mir/workspace/oai_dev/common/utils/T/tracer/to_vcd.c:349:5:
    57 /usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output between 6 and 486 bytes into a destination of size 256
    58    38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
    59       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    60    39 |                                   __glibc_objsize (__s), __fmt,
    61       |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    62    40 |                                   __va_arg_pack ());
    63       |                                   ~~~~~~~~~~~~~~~~~

    2005 /home/mir/workspace/oai_dev/openair1/SIMULATION/TOOLS/random_channel.c:1726:6: warning: conflicting types for ‘set_channeldesc_owner’ due to enum/integer mismatch; have ‘void(channel_desc_t *, uint32_t)’ {      aka ‘void(channel_desc_t *, unsigned int)’} [-Wenum-int-mismatch]
    2006  1726 | void set_channeldesc_owner(channel_desc_t *cdesc, uint32_t module_id) {
    2007       |      ^~~~~~~~~~~~~~~~~~~~~
    2008 In file included from /home/mir/workspace/oai_dev/openair1/SIMULATION/TOOLS/random_channel.c:31:
    2009 /home/mir/workspace/oai_dev/openair1/SIMULATION/TOOLS/sim.h:348:6: note: previous declaration of ‘set_channeldesc_owner’ with type ‘void(channel_desc_t *, channelmod_moduleid_t)’
    2010   348 | void set_channeldesc_owner(channel_desc_t *cdesc, channelmod_moduleid_t module_id);
    2011       |      ^~~~~~~~~~~~~~~~~~~~~

    24209 /home/mir/workspace/oai_dev/openair1/SCHED_UE/phy_procedures_lte_ue.c:954:17: warning: ‘n1_pucch_inter’ may be used uninitialized [-Wmaybe-uninitialized]
    24210   954 |           return(n1_pucch_inter);
    24211       |                 ^
    24212 /home/mir/workspace/oai_dev/openair1/SCHED_UE/phy_procedures_lte_ue.c:647:60: note: ‘n1_pucch_inter’ was declared here
    24213   647 |   uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter;
    24214       |
parent fe613541
......@@ -345,11 +345,9 @@ int main(int n, char **v)
/* setup traces */
for (i = 0; i < nvars; i++) {
char format[256];
if (strlen(vars[i].arg) + strlen(vars[i].vcd_name) > 256-16) abort();
sprintf(format, "%c [%s] %s",
vars[i].boolean ? 'b' : 'l',
vars[i].arg,
vars[i].vcd_name);
int ret = snprintf(format, 256, "%c [%s] %s", vars[i].boolean ? 'b' : 'l', vars[i].arg, vars[i].vcd_name);
if (ret > 255)
abort();
textlog = new_textlog(h, database, vars[i].event, format);
logger_add_view(textlog, vcd_view);
on_off(database, vars[i].event, is_on, 1);
......
......@@ -644,7 +644,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
uint8_t nCCE0,nCCE1,nCCE2,nCCE3,harq_ack1,harq_ack0,harq_ack3,harq_ack2;
ANFBmode_t bundling_flag;
uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter;
uint16_t n1_pucch0 = 0, n1_pucch1 = 0, n1_pucch2 = 0, n1_pucch3 = 0, n1_pucch_inter = 0;
static uint8_t candidate_dl[9]; // which downlink(s) the current ACK/NACK is associating to
uint8_t last_dl=0xff; // the last downlink with valid DL-DCI. for calculating the PUCCH resource index
int sf;
......@@ -951,7 +951,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
// proc->frame_tx%1024,
// proc->subframe_tx,n1_pucch_inter,
// b[0],b[1]);
return(n1_pucch_inter);
return n1_pucch_inter;
} else if ((bundling_flag==multiplexing)&&(SR==0)) { // Table 10.1
if (subframe == 3) {
LOG_I(PHY, "sbuframe=%d \n",subframe);
......
......@@ -1723,8 +1723,9 @@ void free_channel_desc_scm(channel_desc_t *ch) {
free(ch);
}
void set_channeldesc_owner(channel_desc_t *cdesc, uint32_t module_id) {
cdesc->module_id=module_id;
void set_channeldesc_owner(channel_desc_t *cdesc, channelmod_moduleid_t module_id)
{
cdesc->module_id = module_id;
}
void set_channeldesc_name(channel_desc_t *cdesc,char *modelname) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment