<div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">

<br>
</div>I'm rather confused by this whole thread; for the given analysis, I<br>
don't see how any constructor other than the one actually used to<br>
construct the global in question matters.<br>
<span class=""><font color="#888888"><br></font></span></blockquote></div><div><br></div><div>The problem I was trying to solve is illustrated by:<br><br><div>struct nowHasConstructor</div><div>{</div><div>   int x ;</div>
<div><br></div><div>   withConstructor() : x(3) {} // Constructor added to solve uninitialized variable problem with uses of this type on the stack.</div><div>} ;<br></div><div><br></div><div>struct b</div><div>{</div><div>
   nowHasConstructor d ;</div><div>} ;</div><div><br></div><div><div>struct a</div><div>{</div><div>   b c ;</div><div>} ;</div></div><div><br></div><div>struct bigDisgustingStructureContainingWayTooManyOfTheTypesInOurProduct</div>
<div>{</div><div>   // ... lots of stuff</div><div><br></div><div>   struct a ; </div><div><br></div><div>   // ... lots more stuff</div><div>} ;</div><div><br></div><div>bigDisgustingStructureContainingWayTooManyOfTheTypesInOurProduct     theBigGiantGlobalVariable ;<br>
</div><div><br></div><div class="gmail_extra"><div>I'd added the constructor for good reasons and it should solve the usage problems we have with this type in some cases.  However, the type in question also ends up indirectly included in the big ugly global.</div>
<div><br></div><div>That big ugly global can't have global constructors due to an AIX issue: a pure-C linked app won't invoke global constructors from a C++ shared lib unless it is dynamically loaded.  For this reason we forbid global  constructors in our "application" library, at least on AIX.  On that platform, we explicitly fail our link of this library if we find a linker reference to such a constructor (deleting the library in the make rule).</div>
<div><br></div></div></div><div>This question was motivated by me trying to track down what made theBigGiantGlobalVariable now require construction (I knew what change triggered this but not exactly where it caused the trouble).  I found it three levels deep in a couple of places (not obvious by inspection, but my AST visitor  was able to help me find it, since I was able to dump all the direct and indirect dependencies of the bigDisguistingType).</div>
<div><br></div><div>-- <br></div>Peeter<br>
</div>