From f7783cf76f7b60437f666fa1b5007237e48c65ad Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sat, 25 Feb 2023 13:34:44 +0100 Subject: dump.c - cast sprintf args properly to silence build warning under clang Silence the following warnings: dump.c:2688:25: warning: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'int') [-Wformat] r->offs[n].start, r->offs[n].end, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./embed.h:831:72: note: expanded from macro 'sv_catpvf' # define sv_catpvf(a,...) Perl_sv_catpvf(aTHX_ a,__VA_ARGS__) ^~~~~~~~~~~ dump.c:2688:43: warning: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'int') [-Wformat] r->offs[n].start, r->offs[n].end, ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ ./embed.h:831:72: note: expanded from macro 'sv_catpvf' # define sv_catpvf(a,...) Perl_sv_catpvf(aTHX_ a,__VA_ARGS__) ^~~~~~~~~~~ 2 warnings generated. --- dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dump.c') diff --git a/dump.c b/dump.c index 62f41b4392..a5e80a0cfb 100644 --- a/dump.c +++ b/dump.c @@ -2685,7 +2685,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo * show one more than we have nparens. */ for(n = 0; n <= r->nparens; n++) { sv_catpvf(d,"%" IVdf ":%" IVdf "%s", - r->offs[n].start, r->offs[n].end, + (IV)(r->offs[n].start), (IV)(r->offs[n].end), n+1 > r->nparens ? " ]\n" : ", "); } Perl_dump_indent(aTHX_ level, file, " %" SVf, d); -- cgit v1.2.1