This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add new builtin __SANITIZE_UNDEFINED__ macros for fsanitize=undefined switch
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Kamil Rytarowski <n54 at gmx dot com>
- Cc: gcc-patches at gcc dot gnu dot org, dvyukov at google dot com, kcc at google dot com, vitalybuka at google dot com
- Date: Sat, 21 Sep 2019 16:51:40 +0200
- Subject: Re: [PATCH] Add new builtin __SANITIZE_UNDEFINED__ macros for fsanitize=undefined switch
- References: <20190921113110.14188-1-n54@gmx.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 <n54@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