On Fri, Oct 28, 2022 at 09:36:23AM +0200, Peter Eisentraut wrote: > Would there be a use for that? It's currently only used in the atomics > code.
Yep, but they would not trigger when using atomics in the frontend code. We don't have any use for that in core on HEAD, still that could be useful for some external frontend code? Please see the attached. -- Michael
diff --git a/src/include/c.h b/src/include/c.h index d70ed84ac5..12ff782a63 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -800,7 +800,12 @@ typedef NameData *Name; #include <assert.h> #define Assert(p) assert(p) #define AssertMacro(p) ((void) assert(p)) -#define AssertPointerAlignment(ptr, bndr) ((void)true) + +/* + * Check that `ptr' is `bndr' aligned. + */ +#define AssertPointerAlignment(ptr, bndr) \ + Assert(TYPEALIGN(bndr, (uintptr_t)(ptr)) == (uintptr_t)(ptr)) #else /* USE_ASSERT_CHECKING && !FRONTEND */
signature.asc
Description: PGP signature