Dec. 19, 2025
5:12 p.m.
Hi, Gcc with -Wall -Wextra -Wtype-limits produces warnings with: #define TYPE_SIGNED(T) ((T)-1) < 0) error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits] Perhaps use something that checks the sign bit directly? #define TYPE_SIGNED(T) \ (((T)~(T)0 >> (sizeof(T) * CHAR_BIT - 1)) == (T)-1) Or something from NetBSD's <sys/cdefs.h>? christos