FOME-Tech / fome-fw

Free Open Motorsports ECU
https://www.fome.tech
Other
34 stars 17 forks source link

-Werror=stringop-overflow #399

Closed rusefillc closed 1 month ago

rusefillc commented 3 months ago

if you get ... fault at a particular optimization level, you're probably relying on undefined behavior somewhere

nmschulte commented 1 month ago

This seems to be a false positive issued by GCC; some of this is documented here: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstringop-overflow

Simply re-arranging the private members of static_vector so that m_size is after m_storage allows the Simulator build to pass with the warning treated as error.