Bug 507970 - -Wcalloc-transposed-args warnings in valgrind-di-server.c
Summary: -Wcalloc-transposed-args warnings in valgrind-di-server.c
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.25 GIT
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Floyd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-07 08:23 UTC by correctmost
Modified: 2025-08-18 18:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description correctmost 2025-08-07 08:23:18 UTC
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
Comment 1 Paul Floyd 2025-08-18 18:52:41 UTC
commit e3820cea9796baea40781374e60cce4efe79384a (HEAD -> master, origin/master, origin/HEAD)
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Mon Aug 18 20:51:09 2025 +0200

    Bug 507970 - -Wcalloc-transposed-args warnings in valgrind-di-server.c