[Mspgcc-users] Calling constructors (C++) manually with mspgcc4

2010-10-20 Thread Tobias Baumgartner
Dear list, I'm currently trying to port a project (using C++) from mspgcc (3.2.3) to mspgcc4. It is a generic C++ library, running (among other systems) on top of Contiki (which is a C-based firmware/OS). As far as I know, constructors of global C++ objects are not called automatically, so

Re: [Mspgcc-users] Calling constructors (C++) manually with mspgcc4

2010-10-20 Thread Peter Bigot
Constructors for global C++ objects should be called automatically, as long as you're not doing something in the link phase that disrupts things. My testing with the program below shows that it seems to work. Note that if you fall off the end of main(), the global dtors are called.

Re: [Mspgcc-users] Calling constructors (C++) manually with mspgcc4

2010-10-20 Thread JMGross
Hmmm, what is the definition of __ctors_start? I doubt it is an extern variable pointer to void. It is a constant value. Or more precisely it is no lvalue. There is no memory location where its value is stored. It just has a value, is a linker generated 'constant' reference. But by your extern