On Fri, 9 Dec 2022 14:16:19 GMT, Robbin Ehn <r...@openjdk.org> wrote:
> > What version of GCC are you using? > > gcc 11.3 with libubsan 11.2 > > Also it seem to big overlap with -Wcast-align(=strict) for the > warnings/errors I see and I do like that warning. Do you have an idea if the > coverage are pretty much the same for this particular warning? I.e. is anyone > of them better than the other? You can't really compare them because Undefined Behaviour is a runtime thing rather than a compile-time thing. Something like `x = *(char*)0;` is legal in a conforming C++ program as long as it's never executed. I vastly prefer UB Sanitizer because it detects a ton of stuff that static analysis can't. But there's plenty of room for both. ------------- PR: https://git.openjdk.org/jdk/pull/11604