gnometorule
August 20th, 2011, 11:24 PM
When compiling a function that generically looks as follows...
tokenfct(char* s){
char string[16];
int i;
(.....)
}
...then, on the stack, I find the vars in this order (variable on top at lower memory address) -
Without disabling smash protection using the above flag (== expected order):
int
char*
When using the above flag:
char*
int
(1) Ideas? This seems downright odd.
(2) If you know how to compile w/o smash protection, but still putting the local vars onto the stack in the expected FILO order, kindly advise too.
Both gdb and gcc I'm using are per about a year ago (can pull up v. numbers if that matters).
tokenfct(char* s){
char string[16];
int i;
(.....)
}
...then, on the stack, I find the vars in this order (variable on top at lower memory address) -
Without disabling smash protection using the above flag (== expected order):
int
char*
When using the above flag:
char*
int
(1) Ideas? This seems downright odd.
(2) If you know how to compile w/o smash protection, but still putting the local vars onto the stack in the expected FILO order, kindly advise too.
Both gdb and gcc I'm using are per about a year ago (can pull up v. numbers if that matters).