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

2024-04-08 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/87322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-08 Thread via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/NagyDonat approved this pull request. Thanks for the update! Feel free to merge the commit and initiate the de-alpha process. https://github.com/llvm/llvm-project/pull/87322

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

2024-04-08 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/87322 From 79bbe640c0d60744f484db9965865455b0b15246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 2 Apr 2024 09:59:48 +0200 Subject: [PATCH 1/3] [clang][analyzer] Add "pedantic" mode

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

2024-04-02 Thread Balazs Benics via cfe-commits
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

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

2024-04-02 Thread via cfe-commits
NagyDonat wrote: 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 >

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

2024-04-02 Thread Balázs Kéri via cfe-commits
balazske 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

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

2024-04-02 Thread via cfe-commits
NagyDonat wrote: Personally I like the habit that these options are consistently named "Pedantic" because it highlights that they all provide "true, but not helpful" results. When the users see that an option is named "Pedantic", many of them will be able to immediately conclude that they are

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

2024-04-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Unless you plan to add more heuristics, I'd prefer a more concrete option name, like AssumeSuccessfulWrites=true. This would better describe it imo. https://github.com/llvm/llvm-project/pull/87322 ___

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

2024-04-02 Thread via cfe-commits
@@ -1264,16 +1277,18 @@ void StreamChecker::evalFseek(const FnDescription *Desc, const CallEvent , if (!E.Init(Desc, Call, C, State)) return; - // Bifurcate the state into failed and non-failed. - // Return zero on success, -1 on error. + // Add success state.

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

2024-04-02 Thread via cfe-commits
@@ -1094,6 +1104,9 @@ void StreamChecker::evalFprintf(const FnDescription *Desc, // Add transition for the failed state. The resulting value of the file // position indicator for the stream is indeterminate. + if (!PedanticMode) +return; + NagyDonat

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

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat approved this pull request. Good change, I have a few minor suggestions that tweak comment placement. I felt that it's confusing to have an "Add a transition for" comment directly followed by a seemingly unrelated `if (!PedanticMode)` block -- my suggestions swap

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

2024-04-02 Thread via cfe-commits
@@ -1059,6 +1066,9 @@ void StreamChecker::evalFputx(const FnDescription *Desc, const CallEvent , // Add transition for the failed state. The resulting value of the file // position indicator for the stream is indeterminate. + if (!PedanticMode) +return; +

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

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/87322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Balázs Kéri (balazske) Changes The checker may create failure branches for all stream write operations only if the new option "pedantic" is set to true. Result of the write operations is often not checked in typical code. If failure

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

2024-04-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/87322 The checker may create failure branches for all stream write operations only if the new option "pedantic" is set to true. Result of the write operations is often not checked in typical code. If failure