automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c++ link order problems


From: Benoit Sigoure
Subject: Re: c++ link order problems
Date: Tue, 28 Nov 2006 18:51:18 +0100
User-agent: Internet Messaging Program (IMP) H3 (4.0.2)

Quoting Bob Proulx <address@hidden>:

Dan McMahill wrote:
Ralf Wildenhues wrote:
>Just curious: what's the reason for the ordering constraint?

When static objects use inheritance, the base class must be initialized
before anything can be derived from it.  At least that's what I've been
told.  On this particular project, I'm just the build system monkey and
not the c++ programmer ;)  In fact, I'm not a c++ programmer at all.  In
the c programs I've written the link order wasn't important.

IIRC C++ says that the initialization order of global static objects
is either implementation defined or undefined, I don't remember which,
and so basically one cannot count on the order.  This means that any
application that is depending upon this order is buggy.  A correct C++
program won't have a link order dependency.

You're right, the initialization order is unspecified. The standard only says
(3.6.2.1) that within the same translation unit, they "shall be initialized in
the order in which their definition appears in the translation unit."

 This is probably the same
with Benoit Sigoure's issue with Sony's SDK too.

I don't know, in my case we were using MKBIN (a tool provided by Sony to link
stuff) and I have no idea why the stubs must appear first, but they have to.

--
SIGOURE Benoit aka Tsuna
  _____
 /EPITA\ Promo 2008, LRDE





reply via email to

[Prev in Thread] Current Thread [Next in Thread]