4 ms·
I was not talking about this, but about aliasing a variable on the same translation unit. int x = 7; void f() { /* do things using x */ } void insi
by enriquto 6y ago
I was not talking about this, but about aliasing a variable on the same translation unit.
int x = 7;
void f() { /* do things using x */ }
void insidious_function(int *p) { *p = 3; }
now, inside f you cannot be sure that x equals 7, even if you never write into it. You may call some functions, that in turn call the insidious function that receives the address of x as a parameter. There's no way to be sure that the value of x is not changed, just by looking at your code.