[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

Shunsuke Watanabe via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 18 01:31:56 PDT 2025


s-watanabe314 wrote:

Thank you for the feedback!
 
> IIRC GCC is not even consistent with the combination of these flags.

In GCC 14, as I previously mentioned [here](https://discourse.llvm.org/t/the-priority-of-fno-fast-math-regarding-complex-number-calculations/84679/8), `-f[no-]cx-fortran-rules` seems to have a higher priority than other options and does not follow the "last-flag-wins" behavior. From my investigation, among the combinations of GCC options (`-f[no-]fast-math`, `-f[no-]cx-limited-range`, `-f[no-]cx-fortran-rules`), there are 7 cases where the behavior differs from "last-flag-wins". I have added these as tests for Case B and C in `range-warnings.c`.

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


More information about the cfe-commits mailing list