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

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 01:42:30 PDT 2024


================
@@ -1264,16 +1277,18 @@ void StreamChecker::evalFseek(const FnDescription *Desc, const CallEvent &Call,
   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.
   ProgramStateRef StateNotFailed = E.bindReturnValue(State, C, 0);
-  ProgramStateRef StateFailed = E.bindReturnValue(State, C, -1);
-
   // No failure: Reset the state to opened with no error.
   StateNotFailed =
       E.setStreamState(StateNotFailed, StreamState::getOpened(Desc));
   C.addTransition(StateNotFailed);
 
+  // Add failure state.
----------------
NagyDonat wrote:

```suggestion
  // In pedantic mode, also add a failure state.
```

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


More information about the cfe-commits mailing list