This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: preserving static, global (ident) strings in 3.4.x?
- From: Jim Wilson <wilson at specifixinc dot com>
- To: "Remy X.O. Martin" <vsxo at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 19 Jul 2004 10:12:52 -0700
- Subject: Re: preserving static, global (ident) strings in 3.4.x?
- References: <20040718182610.3614bdbc@bola.college-de-france.fr>
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