Consider the following declaration:
int a[M][N]; // M and N are known compile-time
It would be legal to treat him as it was declared as:
int a[N][M];
or even:
int a[A][B]; // where A * B = M * N
in C without breaking its rules (bad)?
I found that it can be executed without any throws:
Note that we cannot directly bind a pointer to p1 . However, the compiler does not complain when p2 assigned to ptr_temp , even if it seems potentially dangerous (it does not require any casting for this). Is it really sanitized? If so, why does this prohibit the first appointment?
c c11
Grzegorz szpetkowski
source share