]> sourceware.org Git - systemtap.git/commit
bpf-translate.cxx: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed...
authorSergei Trofimovich <slyich@gmail.com>
Fri, 22 Dec 2023 19:42:38 +0000 (19:42 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 25 Dec 2023 11:05:01 +0000 (06:05 -0500)
commitd42139cf9cd26d0c0363fcfe007716baeb8de517
treefd9b6b4595b21e2040e9893cff6982dc10b1a565
parent9f115dda981dd279ab838093b1b1068163a63875
bpf-translate.cxx: 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 `systemtap`:

    bpf-translate.cxx: In function 'bpf::BPF_Section* bpf::output_probe(BPF_Output&, program&, const std::string&, unsigned int)':
    bpf-translate.cxx:5044:39: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
     5044 |   bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
          |                                       ^~~~~~~~~~~~~~~~
    bpf-translate.cxx:5044:39: note: earlier argument should specify number of elements, later size of each element
bpf-translate.cxx
This page took 0.026965 seconds and 5 git commands to generate.