Jonathan Wakely
89552346e3
libstdc++: Fix std::counting_semaphore<> default max value
...
My recent (uncommitted) changes to support a 64-bit __platform_wait_t
for FreeBSD and Darwin revealed a problem in std::counting_semaphore.
When the default template argument is used and __platform_wait_t is a
64-bit type, the numeric_limits<__platform_wait_t>::max() value doesn't
fit in ptrdiff_t and so we get ptrdiff_t(-1), which fails a
static_assert in the class body.
The solution is to cap the value to PTRDIFF_MAX instead of allowing it
to go negative.
libstdc++-v3/ChangeLog:
* include/bits/semaphore_base.h (__platform_semaphore::_S_max):
Limit to PTRDIFF_MAX to avoid negative values.
* testsuite/30_threads/semaphore/least_max_value.cc: New test.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com >
2025-11-27 09:43:24 +00:00
..
2025-03-27 13:47:30 +01:00
2025-08-21 11:54:41 +02:00
2025-01-02 11:59:57 +01:00
2025-05-22 14:20:35 +02:00
2025-01-02 11:59:57 +01:00
2025-11-15 21:45:44 +00:00
2025-01-10 21:06:21 +00:00
2025-06-06 09:52:31 +01:00
2025-06-06 09:52:31 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-11-19 09:14:05 -08:00
2025-04-15 09:24:58 +01:00
2025-09-04 15:30:00 +02:00
2025-05-29 11:49:03 +01:00
2025-01-02 11:59:57 +01:00
2025-06-04 14:55:40 -04:00
2025-04-29 10:52:59 +01:00
2025-01-02 11:59:57 +01:00
2025-10-10 09:23:01 +02:00
2025-10-15 21:54:56 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-04-15 09:24:58 +01:00
2025-07-11 08:34:17 +01:00
2025-06-02 13:52:35 +02:00
2025-09-27 21:18:42 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-10-10 09:00:22 +02:00
2025-11-13 14:29:15 +00:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-11-18 11:51:16 +01:00
2025-01-02 11:59:57 +01:00
2025-07-15 10:25:34 +01:00
2025-10-20 17:42:19 +02:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-02-25 22:27:14 +01:00
2025-10-14 15:47:20 +01:00
2025-01-02 11:59:57 +01:00
2025-10-08 17:06:20 +01:00
2025-01-02 11:59:57 +01:00
2025-11-03 18:55:06 +03:00
2025-01-02 11:59:57 +01:00
2025-09-11 14:38:59 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-08 12:45:37 +00:00
2025-04-29 10:52:59 +01:00
2025-01-02 11:59:57 +01:00
2025-03-19 23:29:06 +00:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-07-11 08:34:13 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-06-02 13:52:35 +02:00
2025-01-02 11:59:57 +01:00
2025-08-26 18:16:04 +02:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-04-29 10:52:59 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-09-26 11:05:49 +01:00
2025-05-06 17:19:25 +01:00
2025-11-03 21:32:25 +03:00
2025-10-07 12:11:21 +01:00
2025-09-26 11:01:08 +01:00
2025-02-15 10:58:56 +00:00
2025-09-17 14:14:37 -04:00
2025-08-18 14:05:06 +02:00
2025-09-12 21:46:48 +01:00
2025-11-26 11:45:30 +01:00
2025-07-15 10:25:48 +01:00
2025-09-17 14:14:37 -04:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-11-21 15:30:49 +00:00
2025-04-29 19:54:35 +01:00
2025-04-29 19:54:35 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-04-29 19:54:35 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-08 12:45:37 +00:00
2025-10-29 21:41:12 +00:00
2025-10-07 12:15:28 +01:00
2025-11-27 09:43:24 +00:00
2025-10-14 14:38:30 +02:00
2025-10-11 00:09:19 +01:00
2025-07-09 12:14:40 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-05-27 12:11:43 +01:00
2025-04-29 10:52:59 +01:00
2025-10-14 17:26:42 +01:00
2025-01-02 11:59:57 +01:00
2025-09-26 11:05:59 +01:00
2025-09-26 11:05:59 +01:00
2025-04-11 13:56:03 +02:00
2025-09-22 15:59:21 +02:00
2025-09-23 16:38:28 +01:00
2025-09-26 11:05:49 +01:00
2025-09-26 11:05:49 +01:00
2025-10-22 14:48:04 +01:00
2025-07-19 00:10:10 +01:00
2025-07-07 21:50:51 +01:00
2025-04-11 13:56:03 +02:00
2025-10-14 15:47:20 +01:00
2025-10-14 15:47:20 +01:00
2025-10-14 15:47:20 +01:00
2025-01-02 11:59:57 +01:00
2025-09-03 12:16:18 +01:00
2025-04-25 13:02:04 +02:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-10-14 15:47:20 +01:00
2025-04-25 13:02:04 +02:00
2025-06-12 18:41:30 +02:00
2025-10-14 15:47:20 +01:00
2025-10-01 13:54:59 +01:00
2025-08-26 18:18:32 +02:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-10-15 21:54:56 +01:00
2025-10-08 18:02:39 +02:00
2025-11-14 18:27:01 +01:00
2025-04-29 10:52:59 +01:00
2025-03-06 16:46:19 +00:00
2025-09-10 23:24:10 +01:00
2025-10-14 15:47:20 +01:00
2025-10-14 15:47:20 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-10-27 11:48:49 +01:00
2025-01-02 11:59:57 +01:00
2025-10-27 09:54:55 +00:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-08-26 18:18:32 +02:00
2025-11-26 08:35:48 +01:00
2025-11-26 08:35:48 +01:00
2025-10-09 15:25:59 +01:00