[all-commits] [llvm/llvm-project] 37c19f: [analyzer] UnixAPIMisuseChecker Get O_CREAT from p...

Alejandro Álvarez Ayllón via All-commits all-commits at lists.llvm.org
Tue Feb 20 01:25:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37c19f9a35c5adad009ad82c608b9ca11155ec06
      https://github.com/llvm/llvm-project/commit/37c19f9a35c5adad009ad82c608b9ca11155ec06
  Author: Alejandro Álvarez Ayllón <alejandro.alvarez at sonarsource.com>
  Date:   2024-02-20 (Tue, 20 Feb 2024)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
    M clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
    A clang/test/Analysis/unix-fns-o_creat.c
    M clang/test/Analysis/unix-fns.c

  Log Message:
  -----------
  [analyzer] UnixAPIMisuseChecker Get O_CREAT from preprocessor (#81855)

Now calling `open` with the `O_CREAT` flag and no mode parameter will
raise an issue in any system that defines `O_CREAT`.

The value for this flag is obtained after the full source code has been
parsed, leveraging `checkASTDecl`.
Hence, any `#define` or `#undefine` of `O_CREAT` following an `open` may
alter the results. Nevertheless, since redefining reserved identifiers
is UB, this is probably ok.



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