This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A question about the global variables initialization.



On Dec 20, 2005, at 2:02 AM, Eric Fisher wrote:


Hello,
For such a program,
int a=0;
int main(void)
{
  ...
}
We will see the compiler put the variable 'a' into the bss section.
That means that 'a' is a non-initialized variable. I don't know if this
 is the gcc's strategy.

Yes for zero'd initialized variables, GCC puts them into BSS to say space in the executable.

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]