https://bugs.kde.org/show_bug.cgi?id=507970

            Bug ID: 507970
           Summary: -Wcalloc-transposed-args warnings in
                    valgrind-di-server.c
    Classification: Developer tools
           Product: valgrind
      Version First 3.25 GIT
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY

These warnings look harmless, but GCC reports transposed arguments in a few
calloc calls:

valgrind-di-server.c: In function ‘mk_Frame_asciiz’:
valgrind-di-server.c:416:29: warning: ‘calloc’ sizes specified with ‘sizeof’ in
the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  416 |    Frame* f = calloc(sizeof(Frame), 1);
      |                             ^~~~~
valgrind-di-server.c:416:29: note: earlier argument should specify number of
elements, later size of each element
valgrind-di-server.c: In function ‘mk_Frame_le64’:
valgrind-di-server.c:465:29: warning: ‘calloc’ sizes specified with ‘sizeof’ in
the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  465 |    Frame* f = calloc(sizeof(Frame), 1);
      |                             ^~~~~
valgrind-di-server.c:465:29: note: earlier argument should specify number of
elements, later size of each element
valgrind-di-server.c: In function ‘mk_Frame_le64_le64’:
valgrind-di-server.c:476:29: warning: ‘calloc’ sizes specified with ‘sizeof’ in
the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  476 |    Frame* f = calloc(sizeof(Frame), 1);
      |                             ^~~~~
valgrind-di-server.c:476:29: note: earlier argument should specify number of
elements, later size of each element
valgrind-di-server.c: In function ‘mk_Frame_le64_le64_le64_bytes’:
valgrind-di-server.c:506:29: warning: ‘calloc’ sizes specified with ‘sizeof’ in
the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  506 |    Frame* f = calloc(sizeof(Frame), 1);
      |                             ^~~~~
valgrind-di-server.c:506:29: note: earlier argument should specify number of
elements, later size of each element
valgrind-di-server.c: In function ‘handle_transaction’:
valgrind-di-server.c:709:24: warning: ‘calloc’ sizes specified with ‘sizeof’ in
the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  709 |    req = calloc(sizeof(Frame), 1);
      |                        ^~~~~
valgrind-di-server.c:709:24: note: earlier argument should specify number of
elements, later size of each element


SOFTWARE/OS VERSIONS
Commit 835317da7bbc compiled on Arch Linux
GCC 15.1.1

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to