tools: fix warnings from Ubuntu strict compiler.
[ccan] / tools / ccanlint / tests / run_tests_valgrind.c
index 4f32ed6c630953373ca461f193a55ddf1484896e..2191f80e3dcfc2ecd2d118fe4c3df6ab26a9b85a 100644 (file)
@@ -49,7 +49,7 @@ static void *do_run_tests_vg(struct manifest *m)
        list_head_init(list);
 
        list_for_each(&m->run_tests, i, list) {
-               run_tests.total_score++;
+               run_tests_vg.total_score++;
                /* FIXME: timeout here */
                cmdout = run_command(m, "valgrind -q %s", i->compiled);
                if (cmdout) {
@@ -61,7 +61,7 @@ static void *do_run_tests_vg(struct manifest *m)
        }
 
        list_for_each(&m->api_tests, i, list) {
-               run_tests.total_score++;
+               run_tests_vg.total_score++;
                /* FIXME: timeout here */
                cmdout = run_command(m, "valgrind -q %s", i->compiled);
                if (cmdout) {
@@ -87,7 +87,7 @@ static unsigned int score_run_tests_vg(struct manifest *m, void *check_result)
 {
        struct list_head *list = check_result;
        struct run_tests_result *i;
-       unsigned int score = run_tests.total_score;
+       unsigned int score = run_tests_vg.total_score;
 
        list_for_each(list, i, list)
                score--;
@@ -107,6 +107,9 @@ static const char *describe_run_tests_vg(struct manifest *m,
        return descrip;
 }
 
+/* Gcc's warn_unused_result is fascist bullshit. */
+#define doesnt_matter()
+
 static void run_under_debugger_vg(struct manifest *m, void *check_result)
 {
        struct list_head *list = check_result;
@@ -119,7 +122,8 @@ static void run_under_debugger_vg(struct manifest *m, void *check_result)
        first = list_top(list, struct run_tests_result, list);
        command = talloc_asprintf(m, "valgrind --db-attach=yes %s",
                                  first->file->compiled);
-       system(command);
+       if (system(command))
+               doesnt_matter();
 }
 
 struct ccanlint run_tests_vg = {