I have a function of this form:
void authenticate() { int auth_flag; char password[16]; ... }
When I debug the program, I see that the auth_flag variable is located after the password variable in the stack (which seems normal).
Now, when I change the order of variable declarations:
void authenticate() { char password[16]; int auth_flag; ... }
I see that the auth_flag variable is still allocated after the password variable in the stack.
What I'm looking for is any way to avoid / control this, whether with compilation options or inside the compiler.
source share