ccanlint: show example we actually compiled when we report warnings.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 6 Dec 2010 02:20:45 +0000 (12:50 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 6 Dec 2010 02:20:45 +0000 (12:50 +1030)
tools/ccanlint/tests/examples_compile.c

index ae0d16d62a8cedd81a5542f88c55dd2c98d71e6c..5aeabed38cbb7f8ec59664c0fd4bf0912081e3a9 100644 (file)
@@ -529,7 +529,14 @@ static void build_examples(struct manifest *m, bool keep,
                                warnings = true;
                                score->error = "Compiling extracted example"
                                        " gave warnings";
-                               score_file_error(score, file[j], 0, err[j]);
+                               error = talloc_asprintf(score,
+                                       "Example:\n"
+                                       "%s\n"
+                                       "Compiler:\n"
+                                       "%s",
+                                       get_ccan_file_contents(file[j]),
+                                       err[j]);
+                               score_file_error(score, file[j], 0, error);
                                goto next;
                        }
                }