[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 09:05:24 PDT 2024


steakhal wrote:

> > Unless you plan to add more heuristics, I'd prefer a more concrete option name, like AssumeSuccessfulWrites=true. This would better describe it imo.
> 
> I do not like totally the name "Pedantic", it could be "AssumeOftenUncheckedOperationsMayFail". I am not sure if this behavior is needed only on write operations, the intent was to remove failure branches from all operations that are often unchecked.

The docs within `checkers.td` says `If false, assume that stream write operations do never fail.`. Given this and your last reply, maybe we should consider elaborating the description to reflect that more operations could be affected by setting this option.

> I feel that "AssumeOftenUncheckedOperationsMayFail" does not provide more information than "Pedantic" (≈ report issues that are often left unchecked), while it is significantly longer, so my preferences are _Pedantic > AssumeSuccessfulWrites > AssumeOftenUncheckedOperationsMayFail_.

I think we can disagree.
Given that this isn't such a serious change, it should be fine to continue as you planned.

One remark, inside the `clang/test/Analysis/stream-pedantic.c` could we have `no-warning` markers for the places where the pedantic mode would raise issues?

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


More information about the cfe-commits mailing list