[master] c13343cf0 Fixed build on i386 macOS with clang-11

Nils Goroll nils.goroll at uplex.de
Wed Apr 6 08:57:05 UTC 2022


commit c13343cf0b1a5f83d2527a14c3bea0c7ad027334
Author: Kirill A. Korinsky <kirill at korins.ky>
Date:   Wed Apr 6 01:06:08 2022 +0200

    Fixed build on i386 macOS with clang-11
    
    Apparently, clang11 on i386 macOS uses `int` instead of `ssize_t` for
    `a- b` where bot `a` and `b` is `char`. It leads to an error:
    ```
    vtc_http.c:392:8: error: format specifies type 'ssize_t' (aka 'long') but the argument has type 'int' [-Werror,-Wformat]
                                p - hp->body, t, *p);
                                ^~~~~~~~~~~~
    ```

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 1cc4d8f24..827c20da4 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -389,7 +389,7 @@ cmd_http_expect_pattern(CMD_ARGS)
 		if (*p != t)
 			vtc_fatal(hp->vl,
 			    "EXPECT PATTERN FAIL @%zd should 0x%02x is 0x%02x",
-			    p - hp->body, t, *p);
+			    (ssize_t) (p - hp->body), t, *p);
 		t += 1;
 		t &= ~0x08;
 	}


More information about the varnish-commit mailing list