Commits on Source 5

  • Raphael Defosseux's avatar
  • mir's avatar
  • Robert Schmidt's avatar
    Allocate correct size of bytes for call_process_id · 88e5f7ec
    Robert Schmidt authored
    call_process_id is a byte_string_t, but prior to this commit, we
    allocate data->len_cpid, which is likely not the right size; instead,
    use the sizeof operator to calculate the right size.
    
    This prevents one of these warnings, depending on compiler (version):
    
      /home/richie/flexric/src/agent/e2_agent.c: In function ‘generate_aindication’:
      /home/richie/flexric/src/agent/e2_agent.c:56:25: warning: allocation of insufficient size ‘8’ for type ‘byte_array_t’ with size ‘16’ [-Walloc-size]
         56 |     ind.call_process_id = malloc(sizeof(data->len_cpid) );
            |                         ^
    
      /oai-ran/openair2/E2AP/flexric/src/agent/e2_agent.c:58:30: error: array subscript 'byte_array_t[0]' is partly outside array bounds of 'unsigned char[8]' [-Werror=array-bounds]
        59  |     ind.call_process_id->buf = data->call_process_id;
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      /oai-ran/openair2/E2AP/flexric/src/agent/e2_agent.c:56:27: note: object of size 8 allocated by 'malloc'
    88e5f7ec
  • Robert Schmidt's avatar
    Use FORTIFY_SOURCE in release builds · 3b7c94f7
    Robert Schmidt authored
    gcc-14 warns when using FORTIFY_SOURCE in debug builds:
    
      /usr/include/features.h:414:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
      414 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
          |    ^~~~~~~
    
    Use it in release builds instead.
    3b7c94f7
  • Mikel Irazabal's avatar
    Merge branch 'fix-warnings' into 'dev' · beabdd07
    Mikel Irazabal authored
    Fix warnings that appear when compiling dev branch with gcc-14 in debug mode
    
    See merge request !49
    beabdd07
Loading
Loading