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

            Bug ID: 522012
           Summary: memcheck reallocarray test no longer builds with musl
    Classification: Developer tools
           Product: valgrind
      Version First 3.27 GIT
       Reported In:
          Platform: NixOS
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 193550
  --> https://bugs.kde.org/attachment.cgi?id=193550&action=edit
Patch to fix the issue

Per POSIX, fprintf comes from stdio.h.  When building with musl, none of the
other included headers provide fprintf.  This build regression was introduced
in 3.27 when this file started calling fprintf.

reallocarray.c: In function ‘main’:
reallocarray.c:16:4: error: implicit declaration of function ‘fprintf’
[-Wimplicit-function-declaration]
   16 |    fprintf(stderr, "Added leak check, expect 40 bytes still
reachable\n");
      |    ^~~~~~~
reallocarray.c:7:1: note: include ‘<stdio.h>’ or provide a declaration of
‘fprintf’
    6 | #include "../../memcheck.h"
  +++ |+#include <stdio.h>
    7 | 
reallocarray.c:16:4: warning: incompatible implicit declaration of built-in
function ‘fprintf’ [-Wbuiltin-declaration-mismatch]
   16 |    fprintf(stderr, "Added leak check, expect 40 bytes still
reachable\n");
      |    ^~~~~~~
reallocarray.c:16:4: note: include ‘<stdio.h>’ or provide a declaration of
‘fprintf’
reallocarray.c:16:12: error: ‘stderr’ undeclared (first use in this function)
   16 |    fprintf(stderr, "Added leak check, expect 40 bytes still
reachable\n");
      |            ^~~~~~
reallocarray.c:16:12: note: ‘stderr’ is defined in header ‘<stdio.h>’; this is
probably fixable by adding ‘#include <stdio.h>’
reallocarray.c:16:12: note: each undeclared identifier is reported only once
for each function it appears in

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

Reply via email to