I read the C11 specs (last draft) and I think I don't really understand it, since I'm getting results that are not consistent with what I (thought I) read.
Here's the spec I referenced to https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
Say that there are two variables
signed int a = -5;
unsigned int b = -5;
If I were to compare the two, a would be promoted to unsigned int and the comparison would be done as unsigned int ?
What if instead I have
signed int a = -5;
unsigned long b = -5;
Would this be compared in unsigned long ? (I don't think it did. I check the assembly code generated with gcc and I could see that it loaded a as a signed integer, why is this the case ?)
Thank you !!