]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/examples_compile.c
ccanlint: don't crash when given --target=hash_if and there's no _info file.
[ccan] / tools / ccanlint / tests / examples_compile.c
index 1ccc620248cadd3b0723de8ee01fcbef8732e687..67412df34e184301cd3894e78080ab546cb8c480 100644 (file)
@@ -121,7 +121,11 @@ static bool compile(const void *ctx,
        file->compiled = maybe_temp_file(ctx, "", keep, file->fullname);
        if (!compile_and_link(ctx, file->fullname, ccan_dir,
                              obj_list(m, file),
-                             "", lib_list(m), file->compiled, output)) {
+                             compiler, cflags,
+                             lib_list(m), file->compiled, output)) {
+               /* Don't keep failures. */
+               if (keep)
+                       unlink(file->compiled);
                talloc_free(file->compiled);
                file->compiled = NULL;
                return false;
@@ -596,7 +600,7 @@ static void build_examples(struct manifest *m, bool keep,
                                      err[1]);
                        }
                }
-               score_file_error(score, i, 0, error);
+               score_file_error(score, i, 0, "%s", error);
                /* This didn't work, so not a candidate for combining. */
                prev = NULL;