C standard only defines:
_Alignof ( type-name )
whereas sizeof is defined as:
sizeof unary-expression
sizeof ( type-name )
However, gcc and clang also accept
_Alignof unary-expression
with the obvious semantics of an implicit typeof on the unary-expression, in the same manner as sizeof.
I’ve encountered this in some code.
Comment #1 by robert.schadek — 2024-12-13T19:34:25Z