On FreeBSD/mips64 intmax_t is long, not long long so format checks fail
with this nice confusing error:
error: format specifies type
'uintmax_t' (aka 'unsigned long long') but the argument has type
'uintmax_t' (aka 'unsigned long') [-Werror,-Wformat]
The following patch fixes it for me:
--- tools/clang/lib/Basic/Targets.cpp.orig
+++ tools/clang/lib/Basic/Targets.cpp
@@ -4981,6 +4981,8 @@
LongDoubleWidth = LongDoubleAlign = 128;
LongDoubleFormat = &llvm::APFloat::IEEEquad;
if (getTriple().getOS() == llvm::Triple::FreeBSD) {
+ IntMaxType = SignedLong;
+ UIntMaxType = UnsignedLong;
LongDoubleWidth = LongDoubleAlign = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble;
}
If a test is required, adding another RUN: line with "-triple
mips64-unknown-freebsd" to test/Sema/format-strings-size_t.c should do
the trick.
Thanks,
Brooks