This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52477] Wrong initialization order? __attribute__((constructor)) vs static data access
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 Mar 2012 14:16:29 +0000
- Subject: [Bug c++/52477] Wrong initialization order? __attribute__((constructor)) vs static data access
- Auto-submitted: auto-generated
- References: <bug-52477-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52477
--- Comment #2 from Pawel Sikora <pluto at agmk dot net> 2012-03-04 14:16:29 UTC ---
you should specify explicit initialization order to avoid gpf, e.g.:
static std::map<int, int> m __attribute__((init_priority(101)));
static void insert() __attribute__((constructor(102)));