Skip to content

stgCallocBytes calloc-transposed-args warning

Summary

With recent GCCs (14.1.1 here) we get:

rts/linker/Elf.c: In function ‘ocGetNames_ELF’:
rts/linker/Elf.c:714:47: error:
     error: ‘stgCallocBytes’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
      714 |    sections = (Section*)stgCallocBytes(sizeof(Section), shnum,
          |                                               ^~~~~~~
    |
714 |    sections = (Section*)stgCallocBytes(sizeof(Section), shnum,
    |                                               ^

rts/linker/Elf.c:714:47: error:
     note: earlier argument should specify number of elements, later size of each element
    |
714 |    sections = (Section*)stgCallocBytes(sizeof(Section), shnum,
    |                                               ^

I guess they added this for alignment reasons.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information