This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: QUESTION ON 2.95.2
> The question is why gcc-2.95.2 would not allocate the gComponents
> when this is clearly declared as static.
Let me try to rephrase your question. Why does gcc not initialise
gComponents in the object file?
I assume that gComponents is indeed allocated - it is
zero-initialized. This happens to every object that needs a
construction procedure. Since the initial value of the array contains
the result of calls like
&nsScriptSecurityManager::GetCID()
the compiler cannot put-in a value at compile time; instead, run-time
initialization is needed.
I assume that RegisterSelf is called before this run-time
initialization occurs. There are many reasons why this could happen; I
don't know who is calling RegisterSelf and when.
Regards,
Martin