I have a function of this form:
void authenticate()
{
int auth_flag;
char password[16];
...
}
When I debug the program I can see that the auth_flag variable is 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 variable auth_flag is still allocated after the password variable in the stack.
What I'm looking for is any way to avoid/control that, whether with a compilation option or in-code compiler directives.