-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Description
@mikee47 and @slaff noted in the Sming repo that the core is calling the c++ ctors in reverse order:
SmingHub/Sming#1825 (comment)
Arduino/cores/esp8266/core_esp8266_main.cpp
Lines 199 to 206 in 074a801
| static void do_global_ctors(void) { | |
| static struct object ob; | |
| __register_frame_info( __eh_frame, &ob ); | |
| void (**p)(void) = &__init_array_end; | |
| while (p != &__init_array_start) | |
| (*--p)(); | |
| } |
I believe w/in a single file/TU, they should be called in the order in which they appear. So calling them backwards may break something if there are inter-object dependencies in global objects.
Metadata
Metadata
Assignees
Labels
No labels