Browse Source

ccanlint: show example we actually compiled when we report warnings.

Rusty Russell 15 years ago
parent
commit
79c5dd6d45
1 changed files with 8 additions and 1 deletions
  1. 8 1
      tools/ccanlint/tests/examples_compile.c

+ 8 - 1
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;
 			}
 		}