From 142e7f3289d7439e600e08153f43a23ca0c3690d Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Thu, 14 May 2015 06:53:31 +0000 Subject: [PATCH] Revert r237339 as sanitizer-ppc64-linux1 does not like it. Complains: /home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:829:30: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat] I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm not sure now how this should be fixed. %lld is non-standard and not accepted by mingw on Windows while PRId64 is bad for this bot. Is long long longer than 64 bits here? if not, why is PRId64 incompatible with it? something seems wrong. Probably all the datatypes should be replaced to unsigned or uint64_t depending upin requirements instead of the non standard long long. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237346 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/c-index-test/c-index-test.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index c19648bba4..56f39c2e12 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -5,7 +5,6 @@ #include "clang-c/CXCompilationDatabase.h" #include "clang-c/BuildSystem.h" #include "clang-c/Documentation.h" -#include "llvm/Support/DataTypes.h" #include #include #include @@ -825,7 +824,7 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) { } break; case CXTemplateArgumentKind_Integral: - printf(" [Template arg %d: kind: %d, intval: %" PRId64 "]", + printf(" [Template arg %d: kind: %d, intval: %lld]", I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I)); break; default: @@ -1362,14 +1361,14 @@ static enum CXChildVisitResult PrintTypeSize(CXCursor cursor, CXCursor p, { long long Size = clang_Type_getSizeOf(T); if (Size >= 0 || Size < -1 ) { - printf(" [sizeof=%" PRId64 "]", Size); + printf(" [sizeof=%lld]", Size); } } /* Print the type alignof if applicable. */ { long long Align = clang_Type_getAlignOf(T); if (Align >= 0 || Align < -1) { - printf(" [alignof=%" PRId64 "]", Align); + printf(" [alignof=%lld]", Align); } } /* Print the record field offset if applicable. */ @@ -1394,10 +1393,10 @@ static enum CXChildVisitResult PrintTypeSize(CXCursor cursor, CXCursor p, FieldName); long long Offset2 = clang_Cursor_getOffsetOfField(cursor); if (Offset == Offset2){ - printf(" [offsetof=%" PRId64 "]", Offset); + printf(" [offsetof=%lld]", Offset); } else { /* Offsets will be different in anonymous records. */ - printf(" [offsetof=%" PRId64 "/%" PRId64 "]", Offset, Offset2); + printf(" [offsetof=%lld/%lld]", Offset, Offset2); } } } @@ -4000,7 +3999,7 @@ static int read_diagnostics(const char *filename) { } static int perform_print_build_session_timestamp(void) { - printf("%" PRId64 "\n", clang_getBuildSessionTimestamp()); + printf("%lld\n", clang_getBuildSessionTimestamp()); return 0; } -- 2.40.0