I have found in my c++ program that assert() calls abort() in a case similiar to the following code snippet:
int a = -1;
unsigned int b = 5;
assert(a < b);
As a human I can tell that -1 is definitely smaller than 5, regardless of the fact that one is an int and the other an unsigned int. Why can't the compiler?
I have already found the solution, which is that this assert is just nonsensical since an unsigned will always be positive (I had kind of forgotten that the variable in my actual code was an unsigned), but I am just curious as to why this happens.