On Nov 23 2017, Florian Weimer <fweimer@redhat.com> wrote:
+/* Compare the two integers LEFT and RIGHT and report failure if they
+ are different. */
+#define TEST_COMPARE(left, right) \
+ ({ \
+ __typeof__ (left) __left_value = (left); \
+ __typeof__ (right) __right_value = (right); \
+ /* Prevent accidental use with larger-than-long long types. */ \
+ _Static_assert (sizeof (__left_value) <= sizeof (long long), \
+ "left value fits into long long"); \
+ _Static_assert (sizeof (__right_value) <= sizeof (long long), \
+ "right value fits into long long"); \
+ /* Compare the value and the sign, to avoid false equality. */ \
+ /* (A signed value could be converted to an unsigned type.) */ \
Why do you need that? Any signed value converted to unsigned is still
unique.