This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ Static Variable Initialization
- To: "Sarangdhar, NitinX" <nitinx dot sarangdhar at intel dot com>
- Subject: Re: C++ Static Variable Initialization
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 16 Aug 2001 22:28:01 -0300
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <19BD7227A489D411AC5200902746200B169F36@orsmsx55.jf.intel.com>
On Aug 14, 2001, "Sarangdhar, NitinX" <nitinx.sarangdhar@intel.com> wrote:
> I have a C++ code with some static declarations. In the absence of main() is
> there a way to initialize the statics properly?
What appears to be the problem? g++ does emit magic to get C++
globals initialized if you link in the gcc run-time object files,
which are implicitly linked in when you use g++ for linking.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me