[libc-commits] [libc] [libc] Remove hardcoded sizeof in __barrier_type.h (PR #153718)

via libc-commits libc-commits at lists.llvm.org
Wed Aug 20 08:15:27 PDT 2025


================
@@ -36,15 +36,20 @@ class Barrier {
   int wait();
 };
 
-static_assert(
-    sizeof(Barrier) == sizeof(pthread_barrier_t),
-    "The public pthread_barrier_t type cannot accommodate the internal "
-    "barrier type.");
+static_assert(sizeof(Barrier) <= sizeof(pthread_barrier_t),
+              "The public pthread_barrier_t type cannot accommodate the "
+              "internal barrier type.");
 
-static_assert(alignof(Barrier) == alignof(pthread_barrier_t),
+static_assert(alignof(Barrier) <= alignof(pthread_barrier_t),
               "The public pthread_barrier_t type has a different alignment "
----------------
lntue wrote:

Nit: Can you update the error message to reflect the updated condition?

https://github.com/llvm/llvm-project/pull/153718


More information about the libc-commits mailing list