5 ms·
clang's -Wshorten-64-to-32 can catch this: https://clang.llvm.org/docs/DiagnosticsReference.html#wshorten-64-to-32 https://clang.llvm.org/docs/DiagnosticsRefer
by gaul 5y ago
clang's -Wshorten-64-to-32 can catch this:
https://clang.llvm.org/docs/DiagnosticsReference.html#wshorten-64-to-32 https://clang.llvm.org/docs/DiagnosticsReference.html#wshort...
The more general-purpose -Wconversion has many false positives, often around int to char conversion. Some functions like int toupper(int) have an unexpected int return type to deal with special out-of-bound values like EOF.