pathplanner icon indicating copy to clipboard operation
pathplanner copied to clipboard

NamedCommands::registerCommand will crash depending on static initialization order

Open r4stered opened this issue 1 year ago • 0 comments

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:

  1. Create a named command in C++ and call registerCommand on it.
  2. 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

r4stered avatar Apr 18 '24 17:04 r4stered