]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD regtest: update kenv test so that it builds with GCC master
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 22 Aug 2025 06:58:08 +0000 (08:58 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 22 Aug 2025 06:58:08 +0000 (08:58 +0200)
Was missing the memory header for std::make_unique,
and GCC doesn't like using smart pointers with cout so use
get().

memcheck/tests/freebsd/kenv.cpp
memcheck/tests/freebsd/kenv.stderr.exp

index ed821618545f88b974bb169a4e024d54340d5c77..0217ad32ae747d204fb0d2f521c90484c18b5e74 100644 (file)
@@ -2,6 +2,7 @@
 #include <sstream>
 #include <string>
 #include <exception>
+#include <memory>
 #include <cerrno>
 #include <kenv.h>
 #include <unistd.h>
@@ -26,7 +27,7 @@ int main(int argc, char** argv)
 
       if (argc > 1)
       {
-         std::cout << buf << '\n';
+         std::cout << buf.get() << '\n';
       }
 
       res = kenv(42*42, name.c_str(), buf.get(), bufSize);
@@ -69,7 +70,7 @@ int main(int argc, char** argv)
       if (argc > 1)
       {
          // the buffer contains nul separated eleements, this will just print the first
-         std::cout << dump_buf << '\n';
+         std::cout << dump_buf.get() << '\n';
       }
 
       if (0 == geteuid())
index faf3ccc8ab2bd74e7545954d3c5b5bcf225a89e3..fc6b63868454e79aa86f7b9f688ed18836737600 100644 (file)
@@ -2,46 +2,46 @@
 Warning: bad or unimplemented kenv action: 1764
 Syscall param kenv(action) contains uninitialised byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:110)
+   by 0x........: main (kenv.cpp:111)
 
 Syscall param kenv(name) contains uninitialised byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:110)
+   by 0x........: main (kenv.cpp:111)
 
 Syscall param kenv(value) contains uninitialised byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:110)
+   by 0x........: main (kenv.cpp:111)
 
 Syscall param kenv(len) contains uninitialised byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:110)
+   by 0x........: main (kenv.cpp:111)
 
 Syscall param kenv(name) points to unaddressable byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:116)
+   by 0x........: main (kenv.cpp:117)
  Address 0x........ is 0 bytes inside a block of size 32 free'd
    at 0x........: ...operator delete[]... (vg_replace_malloc.c:...)
-   by 0x........: main (kenv.cpp:115)
+   by 0x........: main (kenv.cpp:116)
  Block was alloc'd at
    at 0x........: ...operator new[]... (vg_replace_malloc.c:...)
-   by 0x........: main (kenv.cpp:113)
+   by 0x........: main (kenv.cpp:114)
 
 Syscall param kenv(value) points to unaddressable byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:119)
+   by 0x........: main (kenv.cpp:120)
  Address 0x........ is 0 bytes inside a block of size 32 free'd
    at 0x........: ...operator delete[]... (vg_replace_malloc.c:...)
-   by 0x........: main (kenv.cpp:118)
+   by 0x........: main (kenv.cpp:119)
  Block was alloc'd at
    at 0x........: ...operator new[]... (vg_replace_malloc.c:...)
-   by 0x........: main (kenv.cpp:117)
+   by 0x........: main (kenv.cpp:118)
 
 Syscall param kenv(value) points to unaddressable byte(s)
    at 0x........: kenv (in /...libc...)
-   by 0x........: main (kenv.cpp:120)
+   by 0x........: main (kenv.cpp:121)
  Address 0x........ is 0 bytes after a block of size 1,024 alloc'd
    at 0x........: ...operator new[]... (vg_replace_malloc.c:...)
-   by 0x........: main (kenv.cpp:18)
+   by 0x........: main (kenv.cpp:19)
 
 
 HEAP SUMMARY: