Talk:X86 Disassembly/Variables

"Static" Local Variables
The line "This shows that the Microsoft C compiler creates static variables in the .bss section." is not 100% correct. While the variable is indeed in the  section in the case used as an example, Visual C++ (the C/C++ compiler) operates on very slightly more complex logic:
 * If the static variable is initialised to a non-zero value, it is placed in the  segment.
 * Otherwise, the variable is placed in the  segment.

This can be observed by compiling a simple source file with

will be in its function's  segment, while   (and   in C++) will be in the   segment.

Also note that in, an additional variable  , of type   , was created to act as a static guard. A static guard of this sort appears to be automatically generated whenever a local static variable is dynamically initialised, and only when a local static variable is dynamically initialised; to my knowledge, it will always be ,   , and non- /.

24.222.178.254 (discuss) 20:28, 28 April 2016 (UTC)

Global Variables
To avoid confusion, I think "Global Variables" should not be on the main page until the section includes some content. Shnizzedy (talk) 18:05, 27 April 2008 (UTC)