This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: init_priority across different namespaces
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Sergey Kljopov <hlodvig at unipro dot ru>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Mon, 6 May 2013 15:38:36 -0700
- Subject: Re: init_priority across different namespaces
- References: <51882EFB dot 2050803 at unipro dot ru>
On Mon, May 6, 2013 at 3:30 PM, Sergey Kljopov <hlodvig@unipro.ru> wrote:
> Hi,
>
> Is init_priority affects initialization order across different namespaces?
> Means in the code (the same file)
> namespace x_sp { Foo a_x __attribute__ ((init_priority (2000))); }
> namespace y_sp { Foo a_y __attribute__ ((init_priority (1000))); }
> which object will be initialized first?
init_priority is global across all translation units.
Thanks,
Andrew
>
> Sergey Kljopov
>
>