From: Paul Floyd Date: Fri, 22 Aug 2025 06:58:08 +0000 (+0200) Subject: FreeBSD regtest: update kenv test so that it builds with GCC X-Git-Tag: VALGRIND_3_26_0~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e8790f5af6b4d7f0daf3d40c2abbae990f29d3e;p=thirdparty%2Fvalgrind.git FreeBSD regtest: update kenv test so that it builds with GCC Was missing the memory header for std::make_unique, and GCC doesn't like using smart pointers with cout so use get(). --- diff --git a/memcheck/tests/freebsd/kenv.cpp b/memcheck/tests/freebsd/kenv.cpp index ed8216185..0217ad32a 100644 --- a/memcheck/tests/freebsd/kenv.cpp +++ b/memcheck/tests/freebsd/kenv.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -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()) diff --git a/memcheck/tests/freebsd/kenv.stderr.exp b/memcheck/tests/freebsd/kenv.stderr.exp index faf3ccc8a..fc6b63868 100644 --- a/memcheck/tests/freebsd/kenv.stderr.exp +++ b/memcheck/tests/freebsd/kenv.stderr.exp @@ -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: