]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-sizeof.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
8 /* Print information about various types. Useful when diagnosing
9 * gcc diagnostics on an unfamiliar architecture. */
11 #pragma GCC diagnostic ignored "-Wtype-limits"
14 printf("%s → %zu bits%s\n", STRINGIFY(t), \
16 strstr(STRINGIFY(t), "signed") ? "" : \
17 ((t)-1 < (t)0 ? ", signed" : ", unsigned"));
24 big_enum_value
= UINT64_C(1),
28 big_enum2_pos
= UINT64_C(1),
29 big_enum2_neg
= UINT64_C(-1),
39 info(long long unsigned);
40 info(__syscall_ulong_t
);
41 info(__syscall_slong_t
);
47 #ifdef __HAVE_DISTINCT_FLOAT128X
67 assert_cc(sizeof(enum BigEnum2
) == 8);
68 printf("big_enum2_pos → %zu\n", sizeof(big_enum2_pos
));
69 printf("big_enum2_neg → %zu\n", sizeof(big_enum2_neg
));