Would it break the language or existing code if we'd add safe signed/unsigned compares to C/C++?
After reading this question on signed/unsigned compares (they come up every couple of days I'd say): Signed / unsigned comparison and -Wall I wondered why we don't have proper signed unsigned compares and instead this horrible mess? Take the output from this small program: #include <stdio.h> #define C(T1,T2)\ {signed T1 a=-1;\ unsigned T2 b=1;\ printf("(signed %5s)%d < (unsigned %5s)%d = %d\n",#T1,(int)a,#T2,(int)b,(a<b));}\ #define C1(T) printf("%s:%d\n",#T,(int)sizeof(T)); C(T,char);C(T,short);C(T,int);C(T,long); int main() { C1(char); C1(short); C1(int); C1(long); } Compiled with my