[cfe-commits] r84318 - /cfe/trunk/tools/c-index-test/c-index-test.c

Ted Kremenek kremenek at apple.com
Fri Oct 16 23:42:15 PDT 2009


Author: kremenek
Date: Sat Oct 17 01:42:15 2009
New Revision: 84318

URL: http://llvm.org/viewvc/llvm-project?rev=84318&view=rev
Log:
Fix compiler warning: "ISO C90 forbids mixed declarations and code"

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=84318&r1=84317&r2=84318&view=diff

==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Sat Oct 17 01:42:15 2009
@@ -87,15 +87,21 @@
     return 0;
   }
   {
-  CXIndex Idx = clang_createIndex();
+  CXIndex Idx;
+  CXTranslationUnit TU;
+  enum CXCursorKind K = CXCursor_NotImplemented;
+  
+  Idx = clang_createIndex();
+  
   if (!strcmp(argv[2], "local"))
     clang_wantOnlyLocalDeclarations(Idx);
-  CXTranslationUnit TU = clang_createTranslationUnit(Idx, argv[1]);
+
+  TU = clang_createTranslationUnit(Idx, argv[1]);
+
   if (!TU) {
     fprintf(stderr, "Unable to load translation unit!\n");
     return 1;
   }
-  enum CXCursorKind K = CXCursor_NotImplemented;
 
   if (!strcmp(argv[2], "all") || !strcmp(argv[2], "local")) {
     clang_loadTranslationUnit(TU, TranslationUnitVisitor, 0);





More information about the cfe-commits mailing list