https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94859

--- Comment #1 from doug mcilroy <doug at cs dot dartmouth.edu> ---
gcc accepts
        struct X {int a; int :0;} x;
and rejects
        struct Y {int a; :0;} y;
in conflict with the final sentence in this quote from the C standard, Section
6.7.2.1, Structure and union specifiers, paragraph #4:

"The expression that specifies the width of a bit-field shall be an integer
constant expression with a nonnegative value that does not exceed the width of
an object of the type that would be specified were the colon and expression
omitted. If the value is zero, the declaration shall have no declarator."

See also Section 3.14 memory location, paragraph #4 EXAMPLE.

Reply via email to