This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++3: Static Initializers occur twice in Binary
- From: Glenn Burkhardt <glenn at aoi-industries dot com>
- To: Frank Mehnert <fm3 at os dot inf dot tu-dresden dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Dec 2003 20:40:42 -0500
- Subject: Re: g++3: Static Initializers occur twice in Binary
> Hi,
>
> in the attached example, the constructor of class A is generated twice.
> I have tested thish with g++-3.3.2 and g++-3.2.3. "objdump -tC" shows
> two occurences of constructor A::A. Please could anyone tell me how to
> prevent this behavior? g++-2.95 produced only one constructor.
I don't think you can. This is a known bug (or feature), which also prevents
gdb from setting break points in constructors (which is a known bug, or
feature).
It's been around for at least two years, and continues to be reported.
Please see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3187
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10512