[clang] [Serialization] Downgrade error to warning for inconsistent language flags (PR #117840)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 07:20:20 PST 2024


AaronBallman wrote:

> Some other thoughts about false-positive error diagnostics. I am wondering, if we don't want false-positive error diagnostics at all, then we have to do what I proposed in this PR (to downgrade errors to warnings for inconsistent flags). Otherwise, we can always construct at least one example that it is false-positive to diagnose the inconsistency. e.g.,

I see where your logic is coming from -- we have false positive error diagnostics, we know those are unacceptable, so if we downgrade everything to warnings then we no longer have false positive error diagnostics and that's an improvement.

However, I think that trades false positive error diagnostics for a different kind of unacceptable behavior, which are crashes/assertions/miscompiles.

> The problem may be about the amount of work. Although I am not sure how far we can make it in practice, it is technically doable.

I agree, it's a significant undertaking. We could think of downgrading to warnings as an incremental step, but I think leaving these as errors does two things for us: 1) is the safest default for users in that it avoids crashes and miscompiles, 2) is the more frustrating behavior for users, which adds extra reasons for us to fix the underlying issue with more urgency.

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


More information about the cfe-commits mailing list