I tried the example below, saved as `main.c`. It seems she automatically reorders the static mem. Can that behavior be disabled? Can someone please explain?
#include<stdio.h>
int main(int argc, char** argv)
{
char *p;
char c;
int x;
printf("char p %p\n", &p);
printf("char %p, offset %i\n", &c, (int)((void*)&c-(void*)&p));
printf("integer %p, offset %i\n", &x, (int)((void*)&x-(void*)&p));
return 0;
}
Output on `gcc main.c; ./a.out`
char p 0x7ffc5107dff0
char 0x7ffc5107dfeb, offset -5
integer 0x7ffc5107dfec, offset -4