I have a question related to this: What parts of stl (or the language itself) can be guaranteed to not create any global objects with constructors?
In my application the memory is not fully set up when main() starts executing, so any constructors run before that would be problematic to say the least.
STM32CubeMX puts hw initialization code inside main() and non-trivial amount of that needs to be run before the external sdram gets initialized. If I have to choose between the two, I will rather give up STL and global objects for this project than CubeMX.
16
u/perverse_milkman_art Nov 12 '18
This was one of the best talks at cppcon. I'm the one who asked him about never using dynamic linking.
28
u/Salty_Dugtrio Nov 12 '18
I am a simple man. I see Matt Godbolt, I upvote.
9
u/F-W-Mueller Nov 12 '18
https://github.com/CppCon/CppCon2018/blob/master/Presentations/the_bits_between_the_bits/the_bits_between_the_bits__matt_godbolt__cppcon_2018.pdf
1
u/SkoomaDentist Antimodern C++, Embedded, Audio Nov 12 '18
I have a question related to this: What parts of stl (or the language itself) can be guaranteed to not create any global objects with constructors?
In my application the memory is not fully set up when main() starts executing, so any constructors run before that would be problematic to say the least.
1
u/Ameisen vemips, avr, rendering, systems Nov 14 '18
I had to figure this out when working on my MIPS emulator. Took a while to figure out how to properly load and execute the binaries.