ChuanqiXu9 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.

OK, although I still think it is much better to downgrade the coarse-grained 
error to user controllable warnings, I'd like to follow the communities' 
consensus. I'll try to refactor LangOptions.def to try to make it more precise.

BTW, do you think it is acceptable to add a behavior under a flag? e.g., 
`-fno-error-inconsistent-flags`

https://github.com/llvm/llvm-project/pull/117840
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to