[PATCH] D135360: [clang][analyzer] Add some more functions to StreamChecker and StdLibraryFunctionsChecker.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 08:17:33 PDT 2022


balazske added a comment.

About the "ftell" problem: The POSIX rules are really an extension of the C standard rules. At `ftell` according to C standard `errno` should be set to a positive value if error occurs. The POSIX rules extend this: `errno` is not changed if no error occurs. This can be correct, then the CERT `ftell` non-compliant example is wrong (on success `errno` remains always 0). It can be fixed if line `errno=0` is removed from the start of the non-compliant code. It may be best to use the POSIX rules for the checker, because the C standard does not say much and may need to require setting of `errno` to 0 before a standard function call.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135360/new/

https://reviews.llvm.org/D135360



More information about the cfe-commits mailing list