[all-commits] [llvm/llvm-project] 1246b6: [clang][analyzer] Change modeling of 'fileno' in c...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Wed Feb 21 00:18:15 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1246b64faa5eea1553c1c1aad425c31b701fa6ea
      https://github.com/llvm/llvm-project/commit/1246b64faa5eea1553c1c1aad425c31b701fa6ea
  Author: Balázs Kéri <balazs.keri at ericsson.com>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
    M clang/test/Analysis/std-c-library-functions-path-notes.c
    M clang/test/Analysis/stream-errno-note.c
    M clang/test/Analysis/stream-errno.c
    M clang/test/Analysis/stream-error.c
    M clang/test/Analysis/stream-noopen.c

  Log Message:
  -----------
  [clang][analyzer] Change modeling of 'fileno' in checkers. (#81842)

Function 'fileno' fails only if invalid pointer is passed, this is a
case that is often ignored in source code. The failure case leads to
many "false positive" reports when `fileno` returns -1 and this is not
checked in the program. Because this, the function is now assumed
to not fail (this is assumption that the passed file pointer is correct).
The change affects `StdCLibraryFunctionsChecker` and
`StreamChecker`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list