chiark / gitweb /
test-sizeof: show that a small 64 field is not enough to force the enum to be 64...
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 22 May 2018 07:07:35 +0000 (09:07 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commitf313a958abd17a56a09ae76dff59c75dcfdf233a
tree477641602b91d47b5b134f45f7520fecbd0ed1d8
parentc64e9548c4c1b3958601df4929e812d226809f8c
test-sizeof: show that a small 64 field is not enough to force the enum to be 64 bits

On both 32 and 64 bits, the result is:
enum Enum → 32 bits, unsigned
enum BigEnum → 32 bits, unsigned
enum BigEnum2 → 64 bits, unsigned
big_enum2_pos → 4
big_enum2_neg → 8

The last two lines show that even if the enum is 64 bit, and the field of an
enum is defined with UINT64_C(), the field can still be smaller.
src/test/test-sizeof.c