ordering of constructors

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Apr 9 13:29:00 GMT 2004


Neal Becker <ndbecker2@verizon.net> writes:

| Hi.  I'm trying to port CLN-1.1.6 to x86_64.  Currently it segfaults on all
| tests.  The problem appears to be some asm code whose purpose is to make
| sure global constructors are ordered.
| 
| I'm not that familiar yet with this code, but I think the way it is used is
| that if a file F.cc needs a global object A, and A requires B, then a macro
| is used to ensure the constructor for B was called before A.

Why not put a function call in the constructor for A that make sure B
initialized? 

-- Gaby



More information about the Gcc mailing list