Issue 182518
Summary [clang-tidy] detect `errno` being compared with a number literal
Labels clang-tidy, check-request
Assignees
Reporter firewave
    The actual values of the error constants utilized by `errno` are not being document so technically that makes them implementation-defined (it is stated more than specified by the standard might be defined). So checking it against a number might not be portable.

See
https://en.cppreference.com/w/c/error/errno_macros.html
https://en.cppreference.com/w/cpp/error/errno_macros.html
https://www.man7.org/linux/man-pages/man3/errno.3.html

They are actually document as "implementation-defined" in https://en.cppreference.com/w/c/header/errno.html.

And the Visual Studio documentation provides some actual values: https://learn.microsoft.com/en-us/cpp/c-runtime-library/errno-constants.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to