This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9321: ctor not call in lib if a .cpp file doesn't have function called by the executable
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, lecroart at nevrax dot com, nobody at gcc dot gnu dot org
- Date: 15 Jan 2003 15:01:29 -0000
- Subject: Re: c++/9321: ctor not call in lib if a .cpp file doesn't have function called by the executable
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, lecroart at nevrax dot com, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: ctor not call in lib if a .cpp file doesn't have function called by the executable
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Wed Jan 15 07:01:29 2003
State-Changed-Why:
Right, this is standard Unix linker behavior: object files
that are not referenced from outside are discarded. The
file in which you run your constructor is thus simply
thrown away by the linker, which explains why the constructor
is not run.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9321