From 5f1fc92b13a964e883091dae7c3701c662dfdc96 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 14 May 2023 21:55:43 +0200 Subject: Fix -Wtautological-constant-out-of-range-compare in regress_http under OSX compiler warning: test/regress_http.c:968:38: warning: result of comparison of constant 65536 with expression of type 'enum evhttp_cmd_type' is always true [-Wtautological-constant-out-of-range-compare] if (evhttp_request_get_command(req) != EVHTTP_REQ_CUSTOM) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~ --- test/regress_http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/regress_http.c b/test/regress_http.c index 626908c6..1af425e3 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -965,7 +965,8 @@ http_custom_cb(struct evhttp_request *req, void *arg) int empty = evhttp_find_header(evhttp_request_get_input_headers(req), "Empty") != NULL; /* Expecting a CUSTOM request */ - if (evhttp_request_get_command(req) != EVHTTP_REQ_CUSTOM) { + uint32_t command = evhttp_request_get_command(req); + if (command != EVHTTP_REQ_CUSTOM) { fprintf(stdout, "FAILED (custom type)\n"); exit(1); } -- cgit v1.2.1 From 6eba967e1c3aa7a43ef900d8f2e68f2d7867c1e2 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 14 May 2023 22:00:19 +0200 Subject: Suppress -Wmacro-redefined for htonll/ntohll in OSX OSX: test/regress_ws.c:61:9: warning: 'htonll' macro redefined [-Wmacro-redefined] #define htonll(x) \ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_endian.h:141:9: note: previous definition is here #define htonll(x) __DARWIN_OSSwapInt64(x) ^ test/regress_ws.c:65:9: warning: 'ntohll' macro redefined [-Wmacro-redefined] #define ntohll(x) htonll(x) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_endian.h:140:9: note: previous definition is here #define ntohll(x) __DARWIN_OSSwapInt64(x) ^ --- test/regress_ws.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/regress_ws.c b/test/regress_ws.c index df4a84e7..436cb627 100644 --- a/test/regress_ws.c +++ b/test/regress_ws.c @@ -58,10 +58,12 @@ #include "regress_http.h" #include "regress_ws.h" +#undef htonll #define htonll(x) \ ((1 == htonl(1)) \ ? (x) \ : ((uint64_t)htonl((x)&0xFFFFFFFF) << 32) | htonl((x) >> 32)) +#undef ntohll #define ntohll(x) htonll(x) -- cgit v1.2.1