test-sizeof: print the alignments too

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-02-05 18:56:41 +01:00
parent 3c7dddaccf
commit 23cfbcc35e
1 changed files with 6 additions and 5 deletions

View File

@ -13,11 +13,12 @@
#pragma GCC diagnostic ignored "-Wtype-limits"
#define info(t) \
printf("%s → %zu bits%s\n", STRINGIFY(t), \
sizeof(t)*CHAR_BIT, \
strstr(STRINGIFY(t), "signed") ? "" : \
((t)-1 < (t)0 ? ", signed" : ", unsigned"));
#define info(t) \
printf("%s → %zu bits%s, %zu byte alignment\n", STRINGIFY(t), \
sizeof(t)*CHAR_BIT, \
strstr(STRINGIFY(t), "signed") ? "" : \
(t)-1 < (t)0 ? ", signed" : ", unsigned", \
__alignof__(t))
enum Enum {
enum_value,