Otherwise LLVM will optimise strrchr into memrchr on Windows resulting in linker error:
$ cat memrchr_test.c #include <string.h> int main(int argc, char **argv) { return (long)strrchr("KkMm", argv[argc-1][0]); } $ clang memrchr_test.c -O memrchr_test.c:3:12: warning: cast to smaller integer type 'long' from 'char *' [-Wpointer-to-int-cast] return (long)strrchr("KkMm", argv[argc-1][0]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. ld.lld: error: undefined symbol: memrchr >>> referenced by D:/msys64/tmp/memrchr_test-e7aabd.o:(main) clang: error: linker command failed with exit code 1 (use -v to see invocation)
Example taken from MSYS2 Discord and tested with windows-gnu target.