https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119429

--- Comment #20 from Desmond Rhodes <desmond.rhodes at outlook dot com> ---
(In reply to Desmond Rhodes from comment #17)
> Anyway, I've found a way to disable UBSan `-fsanitize=integer` for the
> libstd++.
> 
> If I make the file `ignorelist.txt`:
> 
> ```
> #!special-case-list-v1
> 
> [integer]
> # src:.*gcc.*include.*c\+\+.*
> ```
> 
> And then compile with:
> 
> ```
> clang++ -std=c++23 -fsanitize=integer -fno-sanitize-recover=all
> -fsanitize-ignorelist=ignorelist.txt example.cc -o example
> ```
> 
> The `UndefinedBehaviorSanitizer` is no longer getting triggered, or being
> injected into the libstdc++ code for that matter.
> 
> This is because the ignorelist regex will match with:
> 
> ```
> /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/format
> ```
> 
> Or basically any other libstdc++ headers.

Sorry, it should have been:

```
src:.*gcc.*include.*c\+\+.*
```

Not:

```
# src:.*gcc.*include.*c\+\+.*
```

I forgot to uncomment the line from testing.

Reply via email to