typedef int A;
typedef int B;
void foo(A arg){}
void main(void){
B wrongvar = 7;
foo(wrongvar);
}
Is this construction supposed to return a warning/error, according to the standard? What about the most popular compilers?
Example: we have variables, representing kilograms and meters, and all are type 'int'. We have a function, processing meters. We want the compiler to catch bugs, related to passing kilograms meaning variables variables to that function.
I believe Ada handles that smoothly. What about modern C?