]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: testsuite: cast getpid result
authorAlexandre Oliva <oliva@adacore.com>
Tue, 5 Jul 2022 09:12:27 +0000 (06:12 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Tue, 5 Jul 2022 09:12:27 +0000 (06:12 -0300)
On vxworks, in kernel mode, getpid's return type is a pointer type, so
std::to_string on it fails overload resolution.  Restore the type cast
from the original patch that suggested adding the pid.

for  libstdc++-v3/ChangeLog

* testsuite/util/testsuite_fs.h (nonexistent_path): Convert
the getpid result to an integral type.

libstdc++-v3/testsuite/util/testsuite_fs.h

index 908fcdbcaeed1bc8096a69b19818c4275587df6c..25f8f734dc7924dd9a00365f1359e0a1c37b1970 100644 (file)
@@ -163,7 +163,7 @@ namespace __gnu_test
       file.resize(64);
     // The combination of random counter and PID should be unique for a given
     // run of the testsuite.
-    file += std::to_string(::getpid());
+    file += std::to_string((unsigned long) ::getpid());
     p = std::move(file);
     if (test_fs::exists(p))
       throw test_fs::filesystem_error("Failed to generate unique pathname", p,