[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 02:22:27 PST 2025


nikic wrote:

> I'm tempted to say we should just treat -fwrapv/-fwrapv-pointer/-fno-strict-overflow as aliases for each other. I don't think anyone using -fwrapv is going to be happy that we're turning on overflow optimizations.

Yeah, I'm not entirely sure this change is worthwhile either. My general thinking here was that we already have the `-fno-strict-overflow` flag, which works the same on GCC and Clang and disables all overflow optimization. If someone wants to disable pointer overflow optimization and they're using `-fwrapv` to do that, their code is already broken on GCC. So given that we already have an option that works the same for all compilers and compiler versions, it's best to go for consistency for the rest.

https://github.com/llvm/llvm-project/pull/122486


More information about the cfe-commits mailing list