[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)
Shunsuke Watanabe via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 25 02:10:11 PDT 2025
================
@@ -520,6 +520,9 @@ def warn_drv_math_errno_enabled_after_veclib: Warning<
"math errno enabled by '%0' after it was implicitly disabled by '%1',"
" this may limit the utilization of the vector library">,
InGroup<MathErrnoEnabledWithVecLib>;
+def warn_drv_gcc_incompatible_complex_range_override: Warning<
+ "combination of '%0' and '%1' results in complex number calculations incompatible with GCC">,
----------------
s-watanabe314 wrote:
> // -Wgcc-compat -Wno-overriding-option
warning: complex number calculation is incompatible with GCC; specify '-fcx-fortran-rules' after '-fcx-limited-range' for compatibility
>
> // -Woverriding-option -Wno-gcc-compat
warning: overriding '-fcx-fortran-rules' option with '-fcx-limited-range'
>
> // -Wgcc-compat -Woverriding-option
warning: overriding '-fcx-fortran-rules' option with '-fcx-limited-range' and is incompatible with GCC; specify '-fcx-fortran-rules' after '-fcx-limited-range' for compatibility
Does this mean that if we are going to emit both `-Woverriding-option` and `-Wgcc-compat` warnings, the warning messages should be combined into one? If there is a way to determine whether the `-Woverriding-option` option is specified during driver processing (within `RenderFloatingPointOptions` in `Clang.cpp`), we might be able to implement this using `%select` or similar. However, I don't know how to determine if `-Woverriding-option` is specified.
https://github.com/llvm/llvm-project/pull/144468
More information about the cfe-commits
mailing list