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


Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to