diff options
author | Michael Forney <mforney@mforney.org> | 2019-04-27 20:33:56 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-04-27 20:38:42 -0700 |
commit | 2b34742bf0dbabbdb7335838902323df66974b39 (patch) | |
tree | 021c5487c20d5bbae5ae12c4ddddf81aad135cc6 /test/bitfield-unnamed-size-align.c | |
parent | 1ef0706e1f2e97d0872eb801169de5023c3c8b7f (diff) |
Unnamed bit-fields don't contribute to size or alignment of unions, or size of structs
Diffstat (limited to 'test/bitfield-unnamed-size-align.c')
-rw-r--r-- | test/bitfield-unnamed-size-align.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/bitfield-unnamed-size-align.c b/test/bitfield-unnamed-size-align.c new file mode 100644 index 0000000..505467b --- /dev/null +++ b/test/bitfield-unnamed-size-align.c @@ -0,0 +1,12 @@ +struct s { + int : 8; + char c; +}; +union u { + int : 8; + char c; +}; +int s1 = sizeof(struct s); +int s2 = _Alignof(struct s); +int u1 = sizeof(union u); +int u2 = _Alignof(union u); |