https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93209
--- Comment #1 from John Adriaan <John.Adriaan at BigPond dot com> ---
I've also looked at the `unsigned : 0;` anonymous field. Frankly, it changes
nothing. Maybe it should?
struct S {
bool b : 1;
unsigned i : 1;
unsigned : 0;
}; // S
With the above inserted into the examples given in the original post, there is
no change. According to the standard, `: 0` means "align the _next_ field with
the next alignment boundary." Maybe this is wrong: perhaps it should read "pad
the _current_ `struct` to the next alignment boundary for _this_ field's type."
The above proposal has the advantage that it doesn't change existing code. And
in the unlikely scenario of my "dangling `: 0`" proposal, perhaps that's what
the developer expected anyway?
So I also tried the following:
struct S {
bool b : 1;
unsigned i : 1;
unsigned : 0;
unsigned : 0;
}; // S
Alas, no change.