commit 6fc23bd07d48a9fe01f057ca64e870cd8ebd6025 from: Stefan Sperling date: Fri Oct 16 23:04:50 2020 UTC fix a format string issue in results_test.c Use explicit casts to long long and use %lld in the format string. Clang 10.0.1 complained as follows: results_test.c:78:9: warning: format specifies type 'int' but the argument has type 'long long' [-Wformat] c->left_start ? c->left_start->pos : -1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ commit - cdaa991d59b6083bab30f1bd86345f57717a5670 commit + 6fc23bd07d48a9fe01f057ca64e870cd8ebd6025 blob - 4534bde81ad7ca55467131607a967f7f4ae0d4b6 blob + fabf86c6e5076b4eda2546236f717f27e43cda0b --- test/results_test.c +++ test/results_test.c @@ -69,14 +69,14 @@ void test_minus_after_plus(void) struct diff_chunk *c = &result->chunks.head[i]; enum diff_chunk_type t = diff_chunk_type(c); - printf("[%d] %s lines L%d R%d @L %d @R %d\n", + printf("[%d] %s lines L%d R%d @L %lld @R %lld\n", i, (t == CHUNK_MINUS ? "minus" : (t == CHUNK_PLUS ? "plus" : (t == CHUNK_SAME ? "same" : "?"))), c->left_count, c->right_count, - c->left_start ? c->left_start->pos : -1, - c->right_start ? c->right_start->pos : -1); + (long long)(c->left_start ? c->left_start->pos : -1LL), + (long long)(c->right_start ? c->right_start->pos : -1LL)); } diff_result_free(result); @@ -144,15 +144,15 @@ void test_plus_after_plus(void) ARRAYLIST_FOREACH(c, result->chunks) { enum diff_chunk_type t = diff_chunk_type(c); - printf("[%d] %s lines L%d R%d @L %d @R %d\n", + printf("[%d] %s lines L%d R%d @L %lld @R %lld\n", ARRAYLIST_IDX(c, result->chunks), (t == CHUNK_MINUS ? "minus" : (t == CHUNK_PLUS ? "plus" : (t == CHUNK_SAME ? "same" : "?"))), c->left_count, c->right_count, - c->left_start ? c->left_start->pos : -1, - c->right_start ? c->right_start->pos : -1); + (long long)(c->left_start ? c->left_start->pos : -1LL), + (long long)(c->right_start ? c->right_start->pos : -1LL)); } diff_result_free(result);