asumagic / kag-staging

Issue tracker for the KAG staging build
6 stars 0 forks source link

Validate for format string errors #162

Closed asumagic closed 1 year ago

asumagic commented 1 year ago

The shift to libfmt means that plenty of CONSOLE.addx now reliably throw an exception instead of being mere (inconsequential) UB, even if they are rare enough not to be recognized. We might want to investigate if modern C++ stuff allows us to catch these formatting issues at compile-time (or even compile down the format strings directly) with little intervention.

asumagic commented 1 year ago

Seems like sprintf args cannot be checked compile time, but catching an exception in the console formatting code will suffice to prevent crashes, which is the biggest worry