1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

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

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,