> > GCC correctly puts this warning under -Wextra, and promises not to ever > > make use of this facet of undefined behavior. The only correct patch > > is the one that disables the warning for clang, and possibly adds > > -fwrapv. In GCC, -fwrapv correctly silences ubsan's left-shift > > and signed-overflow warnings. In Clang, this is reported at > > https://llvm.org/bugs/show_bug.cgi?id=25552. It's a heavy hammer > > but it's the safest options as compiler evolve. > > Where /exactly/ do you propose we canonicalize the clang invocation you > would like to support?
In configure where we look for other warning flags. Add -fwrapv and -Wno-shift-negative-value so that they're enabled if the compilers supports them. Paolo