]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use const void* for parameters of some internal helpers [PR125684]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 16 Jun 2026 13:51:53 +0000 (14:51 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 23 Jun 2026 13:35:57 +0000 (14:35 +0100)
libstdc++-v3/ChangeLog:

PR libstdc++/125684
* src/c++11/random.cc (bad_seed, which_source): Change void*
parameters to const void *.

libstdc++-v3/src/c++11/random.cc

index 2f37fd5b88ead7f718a33ec57c451b5e4981a79c..5390f05a4a5636010f27e6a4016ff1f6a78154fd 100644 (file)
@@ -197,7 +197,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 #ifdef USE_LCG
     // TODO: use this to seed std::mt19937 engine too.
     unsigned
-    bad_seed(void* p) noexcept
+    bad_seed(const void* p) noexcept
     {
       // Poor quality seed based on hash of the current time and the address
       // of the object being seeded. Better than using the same default seed
@@ -253,7 +253,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 
     inline Which
     which_source(random_device::result_type (*func [[maybe_unused]])(void*),
-                void* file [[maybe_unused]])
+                const void* file [[maybe_unused]])
     {
 #ifdef _GLIBCXX_USE_CRT_RAND_S
       if (func == &__winxp_rand_s)