This is the mail archive of the gcc-bugs@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]

[Bug c++/32688] Dynamic linking cause static Dtor and Ctor to ran twice on same instance



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-07-09 07:12 -------
This is not a bug in GCC, you are violating the One Definition Rule which does
not need any diagnostic.  
Actually there are two violations, first the class Common are different between
the TUs.
Second you have two definitions of cmn which is a global.

If you use 4.2.0 and above you can use the attribute hidden applied to classes
and objects to get the effect of having a local class/variable to that DSO.

Also by the way you forgot to compile the libraries with PIC which could also
be causing an issue.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32688


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