]> git.ipfire.org Git - thirdparty/elfutils.git/commit
tests: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)
authorSergei Trofimovich <slyich@gmail.com>
Thu, 21 Dec 2023 09:23:30 +0000 (09:23 +0000)
committerMark Wielaard <mark@klomp.org>
Thu, 21 Dec 2023 20:58:45 +0000 (21:58 +0100)
commitae580d48278b9924da7503886b37be34378e1b04
tree31247d013b9ade1fce07c26f89c2f4da619a8d67
parenta2194f6b305bf0d0b9dd49dccd0a5c21994c8eea
tests: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)

`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `elfutils`:

    elfstrmerge.c: In function 'main':
    elfstrmerge.c:450:32: error:
      'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
      450 |   newscnbufs = calloc (sizeof (void *), newshnums);
          |                                ^~~~
    elfstrmerge.c:450:32: note: earlier argument should specify number of elements, later size of each element

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
tests/elfstrmerge.c