help-gplusplus
[Top][All Lists]
Advanced

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

Re: cannot initialize static pointer class member in __attribute__ ((co


From: Paul Pluzhnikov
Subject: Re: cannot initialize static pointer class member in __attribute__ ((constructor))
Date: Fri, 03 Oct 2008 15:28:49 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

jeremy  barrett <jeremyb@gmail.com> writes:

>> The order of static_init...() and initAx() is not specified,
>> gcc-3.3.3 for Linux/x86 calls initAx() after static_init...(),
>> while gcc-4.3.0 calls them in reverse order.
>
> ps - is this documented anywhere, or would i have to read the gcc
> source to know?

The 'info gcc' says for __attribute__((constructor)):

  `constructor'
     The `constructor' attribute causes the function to be called
     automatically before execution enters `main ()'. 

That's *all* gcc promises. No guarantees of exactly when they are
called, nor in which order.

Reading gcc source would let you know what a particular version of
gcc does, but not what guarantees there are. If it's not in the
manual, assume it's not specified.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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