We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
int main(void){ float A; float B; float C; float D; A = 1.2f; B = 2.3f; C = 3.4f; D = B + C; return 0;}
What compiler and optimization level are you using?The compiler is only required to make the sure the function behaves according to the standard -- this does not include debugging. Since your function returns 0, the variables A, B, C and D don't really affect anything and the compiler can eliminate them partially or completely if it wants. In fact, if you look in the Location column of the float case, you can see that B and C have both been put in the same register.You can probably convince the compiler to keep the variables by taking their addresses and passing them to another function, e.g. printf("&A=%p, &B=%p, &C=%p, &D=%p\n", &A, &B, &C, &D);
printf("&A=%p, &B=%p, &C=%p, &D=%p\n", &A, &B, &C, &D);