Initialized variables in .bss

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems that GCC has an optimization that turns

  static int a = 0;

into

  static int a;

and puts the symbol into .bss instead of .data (on GNU/Linux).

Is this correct?  Would it make sense for glibc to rely on this
optimization (purely as an optimization)?

Right now, there is an “define initialized” macro which does not
actually initialize anything, and which could easily be misused for
automatic variables.  Therefore, I want to add the initializer,
expecting GCC to optimize it away if possible.

Florian



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux