On Sat, Sep 21, 2019 at 01:31:10PM +0200, Kamil Rytarowski wrote: > GCC version of https://reviews.llvm.org/D52386 > > 2019-09-21 Kamil Rytarowski <n...@gmx.com> > > * cppbuiltin.c (define_builtin_macros_for_compilation_flags): Add new > builtin __SANITIZE_UNDEFINED__ macros for fsanitize=undefined switch. > * doc/cpp.texi: Document new macros. > > * c-c++-common/lsan/sanitize-undefined-macro.c: New test.
I fail to see a good use case for this, it will just lead people to add workarounds for ubsan diagnostics without actually fixing it for real in their production code. Also, -fsanitize=undefined is a collection of many different sanitizers. Those that want such macros to say provide libubsan definitions on their own can do that in their build system, next to -fsanitize=undefined provide their own -Dwhatever that will make that happen. Jakub