]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
binutils: Fix calloc argument order in coffgrok.c
authorMark Wielaard <mark@klomp.org>
Sun, 21 Jan 2024 23:36:09 +0000 (00:36 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 22 Jan 2024 17:19:43 +0000 (18:19 +0100)
commitdd0c018e72c035330cb4bf8aeeb4e7aa0c9e1337
tree02938bb504a861dce1be890a3165a708d2d36704
parentaa5a36b118ade63ebb189a8a51ef5e9c7ea30505
binutils: Fix calloc argument order in coffgrok.c

GCC 14 will warn about calling calloc with swapped size and count
arguments.

binutils-gdb/binutils/coffgrok.c: In function ‘do_sections_p1’:
binutils-gdb/binutils/coffgrok.c:116:72: error: ‘xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  116 |   struct coff_section *all = (struct coff_section *) (xcalloc (sizeof (struct coff_section),
      |                                                                        ^~~~~~
binutils-gdb/binutils/coffgrok.c:116:72: note: earlier argument should specify number of elements, later size of each element

binutils/

* coffgrok.c (empty_scope): Swap xcalloc arguments.
(empty_symbol): Likewise.
(do_lines): Likewise.
(doit): Likewise.
(coff_grok): Likewise.
binutils/coffgrok.c