Mysterious type conversion warning when using sys/socket.h macro
问题 I'm trying to resolve conversion warnings in our C code base on Solaris 11 64-bit using GCC 9.1 (iso9899:1999) and GNU make 4.2, and I came across this one: warning: unsigned conversion from ‘int’ to ‘long unsigned int’ changes value from ‘-8’ to ‘18446744073709551608’ [-Wsign-conversion] 187 | char ccmsg[CMSG_SPACE(sizeof(int))]; | ^~~~~~~~~~ I know that CMSG_SPACE is defined in sys/socket.h as: /* Amount of space + padding needed for a message of length l */ #define CMSG_SPACE(l) \ (