portage-utils icon indicating copy to clipboard operation
portage-utils copied to clipboard

qgrep: fix -Wcalloc-transposed-args warning

Open emanuele6 opened this issue 1 year ago • 0 comments

I get this warning when compiling portage-utils with gcc (Gentoo 14.2.1_p20240817 p4) 14.2.1 20240817.

qgrep.c: In function ‘qgrep_main’:
qgrep.c:558:40: warning: ‘xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  558 |                         xcalloc(sizeof(depend_atom *), (argc - optind - 1) + 1);
      |                                        ^~~~~~~~~~~
qgrep.c:558:40: note: earlier argument should specify number of elements, later size of each element

emanuele6 avatar Sep 05 '24 11:09 emanuele6