nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
25.77k stars 7.66k forks source link

Avoid address sanitizer on MSVC #1622

Open tim-rex opened 3 months ago

tim-rex commented 3 months ago

Extending on #393 Since MSVC now supports address sanitizer, it appears to be throwing the same issues as other platforms

This PR adds compiler checks and appropriate declspecs for MSVC

Note that _declspec for MSVC must appear before the storage specifier, hence the additional set of STBSP__PUBLICDEF's There's probably a cleaner way to structure that

Manuzor commented 3 months ago

See also #1477 as well as #1350.

Condzi commented 3 months ago

You might add UBSAN as well, since it also flags the tricks used in sprintf library. __attribute__((no_sanitize("undefined")))