]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/tests_compile.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / tools / ccanlint / tests / tests_compile.c
index c939055857021e93c105c2da2352840902b45698..0bafcc64e5ddb6124d956eb265c24fe62eff7ce9 100644 (file)
@@ -16,7 +16,7 @@
 #include "reduce_features.h"
 #include "tests_compile.h"
 
-static const char *can_build(struct manifest *m)
+static const char *can_build(struct manifest *m UNNEEDED)
 {
        if (safe_mode)
                return "Safe mode enabled";
@@ -54,7 +54,7 @@ char *test_obj_list(const struct manifest *m, bool link_with_module,
        return list;
 }
 
-char *test_lib_list(const struct manifest *m, enum compile_type ctype)
+char *test_lib_list(const struct manifest *m, enum compile_type ctype UNNEEDED)
 {
        unsigned int i;
        char **libs;
@@ -66,6 +66,17 @@ char *test_lib_list(const struct manifest *m, enum compile_type ctype)
        return ret;
 }
 
+static char *cflags_list(const struct manifest *m, const char *iflags)
+{
+       unsigned int i;
+       char *ret = tal_strdup(m, iflags);
+
+       char **flags = get_cflags(m, m->dir, get_or_compile_info);
+       for (i = 0; flags[i]; i++)
+               tal_append_fmt(&ret, " %s", flags[i]);
+       return ret;
+}
+
 static bool compile(const void *ctx,
                    struct manifest *m,
                    struct ccan_file *file,
@@ -81,6 +92,7 @@ static bool compile(const void *ctx,
                        cflags,
                        ctype == COMPILE_NOFEAT
                        ? " "REDUCE_FEATURES_FLAGS : "");
+       flags = cflags_list(m, flags);
 
        fname = temp_file(ctx, "", file->fullname);
        if (!compile_and_link(ctx, file->fullname, ccan_dir,
@@ -110,6 +122,7 @@ static void compile_async(const void *ctx,
                        cflags,
                        ctype == COMPILE_NOFEAT
                        ? " "REDUCE_FEATURES_FLAGS : "");
+       flags = cflags_list(m, flags);
 
        compile_and_link_async(file, time_ms, file->fullname, ccan_dir,
                               test_obj_list(m, link_with_module, ctype, ctype),
@@ -198,7 +211,7 @@ struct ccanlint tests_compile = {
 
 REGISTER_TEST(tests_compile);
 
-static const char *features_reduced(struct manifest *m)
+static const char *features_reduced(struct manifest *m UNNEEDED)
 {
        if (features_were_reduced)
                return NULL;