1 |
On Sat, 31 May 2008 01:54:45 +0200 |
2 |
Luca Barbato <lu_zero@g.o> wrote: |
3 |
> > ISO/IEC 14882:1998 section 3.7.1 paragraph 2. |
4 |
> |
5 |
> "If an object of static storage duration has initialization or a |
6 |
> destructor with side effects, it shall not be eliminated even if |
7 |
> it appears to be unused, except that a class object or its copy |
8 |
> may be eliminated as specified in 12.8." |
9 |
> |
10 |
> Unchanged in the 2003 revision. |
11 |
> |
12 |
> Is that related to linking? I don't think so. |
13 |
|
14 |
Linking with as-needed is the stage in which the elimination occurs, |
15 |
and as-needed is the cause of the elimination. So yes, it is related. |
16 |
|
17 |
> Still, PE and ELF are older than the first C++ spec so, IFF your |
18 |
> reading of this chapter is correct, C++ is broken by design. |
19 |
|
20 |
Not at all. Read "The Design and Evolution of C++", and you shall see |
21 |
that requiring changes to the linker where necessary for sensible |
22 |
behaviour was considered acceptable, and with good reason. |
23 |
-- |
24 |
Ciaran McCreesh |