]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libsframe: Fix calloc argument order in dump_sframe_header
authorMark Wielaard <mark@klomp.org>
Sun, 21 Jan 2024 23:12:45 +0000 (00:12 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 22 Jan 2024 17:19:03 +0000 (18:19 +0100)
commitaa5a36b118ade63ebb189a8a51ef5e9c7ea30505
tree570b90f1912d4bccc425e45e6587475c2a5e6c5e
parent5bc519bf0c8d34df4fe5e37511a7ddee518684d1
libsframe: Fix calloc argument order in dump_sframe_header

GCC14 warns about the order of the arguments to calloc

libsframe/sframe-dump.c: In function ‘dump_sframe_header’:
libsframe/sframe-dump.c:70:39: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
   70 |   flags_str = (char*) calloc (sizeof (char), SFRAME_HEADER_FLAGS_STR_MAX_LEN);
      |                                       ^~~~
libsframe/sframe-dump.c:70:39: note: earlier argument should specify number of elements, later size of each element

Fix this by swapping the size and count arguments.

libsframe/

* sframe-dump.c (dump_sframe_header): Swap arguments to calloc
libsframe/sframe-dump.c