llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.15k stars 12.03k forks source link

Enhancement for clang-tidy bugprone-signed-char-misuse check #63280

Open nunema opened 1 year ago

nunema commented 1 year ago

bugprone-signed-char-misuse check is currently limited to assignments and variable declarations where a signed char is assigned to an integer variable.

The header declares character-handling functions (isdigit, isspace, toupper, etc.) that operate on an int argument. In all the cases the argument value should be representable as an unsigned char or should equal to EOF. It is an undefined behavior If the argument has any other value.

It would be very helpful if bugprone-signed-char-misuse check reported the above-mentioned cases as well.

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-tidy