libstdc++: Fix narrowing conversions for 16-bit size_t [PR105681]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 26 May 2022 20:32:55 +0000 (21:32 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 8 Jun 2022 09:52:16 +0000 (10:52 +0100)
commit6666ca1ab44ad8a61e2b916cf4173fe452b78ed6
tree2086080274b928ae29a9185493f5a7c6800b9d29
parent64f5d58d8151324be111ba6e13c50b4b642c41c2
libstdc++: Fix narrowing conversions for 16-bit size_t [PR105681]

On a 16-bit target such as msp430 we get errors about narrowing long
values to size_t, which is only 16-bit. When --enable-libstdcxx-pch is
used the <bits/extc++.h> header breaks the build because of these
narrowing errors.

libstdc++-v3/ChangeLog:

PR libstdc++/105681
* include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp:
Limit ga_sizes array to values that fit in size_t.
* include/ext/random [__SIZE_WIDTH < 32] (sfmt86243)
(sfmt86243_64, sfmt132049, sfmt132049_64, sfmt216091)
(sfmt216091_64): Do not declare.

(cherry picked from commit 367740bf6d3a6627798b3955e5d85efc7549ef50)
libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
libstdc++-v3/include/ext/random