ccanlint: fix spurious warning errors.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 5 Oct 2011 03:40:29 +0000 (14:10 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 5 Oct 2011 03:40:29 +0000 (14:10 +1030)
Because we fork children to do compilations, and we use stdio, we need
to flush stdout before the fork otherwise the child will flush
afterwards.  The compile tests interpret this output as a compiler
warning.

This shows up if you redirect ccanlint output to a file.

tools/ccanlint/async.c

index 5c2c4da73d31b1929b1dd25fcaa513c1b2337e92..ffa18ca80eea529aa0f0ef60639ce17f9ee5cb6c 100644 (file)
@@ -51,6 +51,7 @@ static void run_more(void)
                if (!c)
                        break;
 
+               fflush(stdout);
                if (pipe(p) != 0)
                        err(1, "Pipe failed");
                c->pid = fork();