This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
init_priority(65535) vs constructor/destructor
- To: egcs at egcs dot cygnus dot com
- Subject: init_priority(65535) vs constructor/destructor
- From: Andreas Schwab <schwab at LS5 dot informatik dot uni-dortmund dot de>
- Date: 24 Feb 1999 10:56:59 +0100
With the latest snapshot, when trying to mix the attributes
init_priority(65536) and constructor in the same file you'll get an error:
$ cat ctor.cc
void __attribute__ ((constructor)) init (void) {}
struct X { X (); };
X foo __attribute__ ((init_priority (65535)));
int main () { return 0; }
$ g++ -c ctor.cc
ctor.cc: In function `(static initializers for ctor.cc)':
ctor.cc:4: redefinition of `(static initializers for ctor.cc)'
ctor.cc:4: `(static initializers for ctor.cc)' previously defined here
And when modifying the example slightly by removing the constructor from X
the compiler crashes:
$ cat ctor2.cc
void __attribute__ ((constructor)) init (void) {}
struct X { };
X foo __attribute__ ((init_priority (65535)));
int main () { return 0; }
$ g++ -c ctor2.cc
ctor2.cc:4: Internal compiler error.
ctor2.cc:4: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
ctor2.cc:4: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org