[clang] [clang][Analyzer] Move checker 'alpha.unix.Errno' to 'unix.Errno'. (PR #69469)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 02:41:38 PDT 2023


DonatNagyE wrote:

This [report from vim](https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=vim_v8.2.1920_errno_alpha_unix&newcheck=vim_v8.2.1920_errno_unix&is-unique=on&diff-type=New&report-id=3214372&report-hash=9582050be3f26e8ebf9dcf4c5b0f82b3&report-filepath=%2amemline.c) seems to be a false positive:

![image](https://github.com/llvm/llvm-project/assets/43410265/14bfd4b2-686b-452c-b417-465cdb43f11b)

Readlink returns either -1 (failure, errno is set) or the number of characters read from the symlink entry (i.e. the filename the symlink points to). I don't think that it's possible to create a "symlink to emptystring", so the the checkers should recognize that if the return value is `<= 0`, then it's a failure.


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


More information about the cfe-commits mailing list