[riot-devel] RIOT and static initializers in C++
Raphael.Hiesgen at haw-hamburg.de
Fri Sep 19 17:15:00 CEST 2014
static initializers don’t seem to work on RIOT. Setting a breakpoint in the constructor reveals, that it is never called. I believe the static initialization should occur before calling main. If I am not mistaken, RIOT calls the function startup before the main.
I attached an example program . To try it on RIOT, copy the code into the cpp example. If foo is initialized correctly, data should be set to 1. However, the example prints 0.
Usually the compiler should take care of the initialization. Does someone know why this initialization does not happen on RIOT?
More information about the devel