r237346 - Revert r237339 as sanitizer-ppc64-linux1 does not like it.

Yaron Keren yaron.keren at gmail.com
Wed May 13 23:53:31 PDT 2015


Author: yrnkrn
Date: Thu May 14 01:53:31 2015
New Revision: 237346

URL: http://llvm.org/viewvc/llvm-project?rev=237346&view=rev
Log:
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.


Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=237346&r1=237345&r2=237346&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Thu May 14 01:53:31 2015
@@ -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 <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -825,7 +824,7 @@ static void PrintCursor(CXCursor Cursor,
               }
               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 PrintType
   {
     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 PrintType
                                                   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 *
 }
 
 static int perform_print_build_session_timestamp(void) {
-  printf("%" PRId64 "\n", clang_getBuildSessionTimestamp());
+  printf("%lld\n", clang_getBuildSessionTimestamp());
   return 0;
 }
 





More information about the cfe-commits mailing list