From: Willy Tarreau Date: Fri, 6 Nov 2020 13:24:02 +0000 (+0100) Subject: BUILD: http-htx: fix build warning regarding long type in printf X-Git-Tag: v2.3.2~34 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=37b9630d0a93ff2ffc89a85a095e41db72de1c5b;p=haproxy-2.3.git BUILD: http-htx: fix build warning regarding long type in printf Commit a66adf41e ("MINOR: http-htx: Add understandable errors for the errorfiles parsing") added a warning when loading malformed error files, but this warning may trigger another build warning due to the %lu format used. Let's simply cast it for output since it's just used for end user output. This must be backported to 2.0 like the commit above. (cherry picked from commit 431a12cafeeec7300b7cea7e19b892d4e8c4900d) Signed-off-by: Willy Tarreau --- diff --git a/src/http_htx.c b/src/http_htx.c index ee1bfd3..d3c3f42 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -970,7 +970,7 @@ int http_str_to_htx(struct buffer *buf, struct ist raw, char **errmsg) } if ((flags & HTX_SL_F_CLEN) && h1m.body_len != (raw.len - ret)) { memprintf(errmsg, "payload size does not match the announced content-length (%lu != %lu)", - (raw.len - ret), h1m.body_len); + (unsigned long)(raw.len - ret), (unsigned long)h1m.body_len); goto error; }