[cfe-commits] [PATCH] Fix c-index-test warnings for gcc release build

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Dec 17 12:21:29 PST 2012


Committed in r170366, thanks!

On Dec 17, 2012, at 10:58 AM, Edwin Vane <edwin.vane at intel.com> wrote:

> Hi chapuni,
> 
> The release build was complaining about unused results from chdir(). Now
> fixed.
> 
> Reviewed-By: Kevin P Schoedel <kevin.p.schoedel at intel.com>
> 
> http://llvm-reviews.chandlerc.com/D220
> 
> Files:
>  tools/c-index-test/c-index-test.c
> 
> Index: tools/c-index-test/c-index-test.c
> ===================================================================
> --- tools/c-index-test/c-index-test.c
> +++ tools/c-index-test/c-index-test.c
> @@ -2813,9 +2813,13 @@
>         goto cdb_end;
>       }
> 
> -      chdir(buildDir);
> -      CCmds = clang_CompilationDatabase_getAllCompileCommands(db);
> +      if (chdir(buildDir) != 0) {
> +        printf("Could not chdir to %s\n", buildDir);
> +        errorCode = -1;
> +        goto cdb_end;
> +      }
> 
> +      CCmds = clang_CompilationDatabase_getAllCompileCommands(db);
>       if (!CCmds) {
>         printf("compilation db is empty\n");
>         errorCode = -1;
> @@ -2834,7 +2838,11 @@
>         CCmd = clang_CompileCommands_getCommand(CCmds, i);
> 
>         wd = clang_CompileCommand_getDirectory(CCmd);
> -        chdir(clang_getCString(wd));
> +        if (chdir(clang_getCString(wd)) != 0) {
> +          printf("Could not chdir to %s\n", clang_getCString(wd));
> +          errorCode = -1;
> +          goto cdb_end;
> +        }
>         clang_disposeString(wd);
> 
>         numArgs = clang_CompileCommand_getNumArgs(CCmd);
> <D220.1.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list