From: Rusty Russell Date: Mon, 6 Dec 2010 02:20:45 +0000 (+1030) Subject: ccanlint: show example we actually compiled when we report warnings. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=79c5dd6d4568c796fc3a0260092b0e82ca23261d;hp=9cca4b73c96adeb39ab89027eca9ea5323a3a598 ccanlint: show example we actually compiled when we report warnings. --- diff --git a/tools/ccanlint/tests/examples_compile.c b/tools/ccanlint/tests/examples_compile.c index ae0d16d6..5aeabed3 100644 --- a/tools/ccanlint/tests/examples_compile.c +++ b/tools/ccanlint/tests/examples_compile.c @@ -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; } }