pathplanner
pathplanner copied to clipboard
NamedCommands::registerCommand will crash depending on static initialization order
Describe the bug When calling NamedCommands::registerCommand(), the static vector namedCommands might not be initialized based on the order of compilation.
https://en.cppreference.com/w/cpp/language/siof
To Reproduce Steps to reproduce the behavior:
- Create a named command in C++ and call registerCommand on it.
- Hope the compiler initializes it incorrectly :)
Expected behavior The vector should be initialized properly on the first call
Relevant FRC discord messages:
https://discord.com/channels/176186766946992128/528555967827148801/1230553097307295805