1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Wed, 5 Mar 2025 19:30:14 +0100
Subject: Fix -Wformat
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
cmpfns.c:376:34: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
376 | printf ("%.*s ==> ", l1, field1);
| ~~^~ ~~
| | |
| int size_t {aka long unsigned int}
cmpfns.c:377:34: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
377 | printf ("%.*s\n", l2, field2);
| ~~^~ ~~
| | |
| int size_t {aka long unsigned int}
---
cmpfns.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmpfns.c b/cmpfns.c
index faa2b2d..8ea86c0 100644
--- a/cmpfns.c
+++ b/cmpfns.c
@@ -373,8 +373,8 @@ int cmp_lines (const char* line1, const char* line2,
{
print_errors (abserr, relerr, 0);
}
- printf ("%.*s ==> ", l1, field1);
- printf ("%.*s\n", l2, field2);
+ printf ("%.*s ==> ", (int)l1, field1);
+ printf ("%.*s\n", (int)l2, field2);
}
lines_differ = 1;
}
|