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: preserving static, global (ident) strings in 3.4.x?


Remy X.O. Martin wrote:
I'm used to keeping global strings in all my modules, defined via a macro.

Unused static strings are deleted by the -funit-at-a-time option, which is the default at -O2. You can disable this optimization with -fno-unit-at-a-time. Or you can add __attribute__ ((used)) to variable declarations to prevent them from being optimized away. See the docs for more info.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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