clang's -Wshorten-64-to-32 can catch this:
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.