]> granicus.if.org Git - clang/commitdiff
Fix compiler warning: "ISO C90 forbids mixed declarations and code"
authorTed Kremenek <kremenek@apple.com>
Sat, 17 Oct 2009 06:42:15 +0000 (06:42 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 17 Oct 2009 06:42:15 +0000 (06:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84318 91177308-0d34-0410-b5e6-96231b3b80d8

tools/c-index-test/c-index-test.c

index 1ad48266eee8c3f9d30e176ddf37ed379cd8fb6f..fc84faac2bb7aec7bbe1d1ef1d93727294f91658 100644 (file)
@@ -87,15 +87,21 @@ int main(int argc, char **argv) {
     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);