Quantcast
Channel: Strange stack behavior in C - Stack Overflow
Browsing latest articles
Browse All 7 View Live

Answer by Juliano for Strange stack behavior in C

There is no standard that sets how variables are placed on the stack. What happens in the compiler is much more complicated. In your code, the compiler may even choose to completely ignore and suppress...

View Article



Answer by Alex B for Strange stack behavior in C

I remember reading something about it. All I have now is this obscure link.Just to let everybody know (and for the sake of the archives), it appears to be our kernel extension is running into a known...

View Article

Answer by sigjuice for Strange stack behavior in C

I believe the C standard just talks about the scope and lifetime of variables defined in a block. It makes no promises about how the variables interact with the stack or if a stack even exists.

View Article

Answer by Norman Ramsey for Strange stack behavior in C

The compiler is completely within its rights not to optimize temp1 and temp2 into the same location. It has been many years since compilers generated code for one stack operation at a time; these days...

View Article

Answer by Andrew Grant for Strange stack behavior in C

There is no guarantee what address stack objects will receive regardless of the order they are declared.The compiler can happily reorder the creation and duration of stack variables providing it does...

View Article


Answer by Daniel Earwicker for Strange stack behavior in C

This is completely dependent on the compiler and how it is configured.

View Article

Strange stack behavior in C

I'm worried that I am misunderstanding something about stack behavior in C.Suppose that I have the following code:int main (int argc, const char * argv[]) { int a = 20, b = 25; { int temp1;...

View Article
Browsing latest articles
Browse All 7 View Live




Latest Images