s-watanabe314 wrote: > I'm not sure the combined warning is necessary. I think just stating that the > clang option overrides the GCC option is sufficient since there is no sense > in which clang-specific options can be incompatible with GCC if GCC doesn't > implement the option.
In this patch, when clang-specific options and GCC options are combined, only the override warning is output. The combined warning is output when a GCC option overrides another GCC option. Specifically, there are the following seven cases described in `range-warnings.c`: ``` // Case B: GCC Incompatibility Warnings // Emit warnings because the following cases result in behavior // incompatible with GCC: // (a) -fcx-limited-range -fno-fast-math // (b) -fcx-fortran-rules -fcx-limited-range // (c) -fcx-fortran-rules -fno-cx-limited-range // (d) -fcx-fortran-rules -ffast-math // (e) -fcx-fortran-rules -fno-fast-math // (f) -fno-cx-fortran-rules -fcx-limited-range // (g) -fno-cx-fortran-rules -ffast-math // Case C: Combined A and B Warnings // Emit combined warnings when both A and B apply. This is the default // warning when both apply. The warning message changes to Case A or B // if the user specifies -Wno-gcc-compat or -Wno-overriding-complex-range. ``` In these cases, an override occurs and also an incompatibility with GCC, so I believe a different warning should be output. > I think we're all in agreement that we want to consistently follow "last > command wins" behavior, even when GCC doesn't. This patch isn't changing > that, right? Yes, this patch only changes the warnings and does not change the "last-flag-wins" behavior. https://github.com/llvm/llvm-project/pull/149028 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits