From 4fdec9fb162d1be0e87e15c0d0fbc2db539b27b5 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 13 Sep 2018 19:04:47 +0100 Subject: [PATCH] Avoid undefined char* arithmetic. Use uintptr_t instead of char* for "unusual" pointer arithmetic. --- src/includes/control.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/includes/control.h b/src/includes/control.h index b914bd0..6ba632e 100644 --- a/src/includes/control.h +++ b/src/includes/control.h @@ -228,7 +228,7 @@ inline dasynq::rearm control_conn_cb(eventloop_t * loop, control_conn_watcher * // Get the address of the containing control_connt_t object: _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored \"-Winvalid-offsetof\"") - char * cc_addr = (reinterpret_cast(watcher)) - offsetof(control_conn_t, iob); + uintptr_t cc_addr = reinterpret_cast(watcher) - offsetof(control_conn_t, iob); control_conn_t *conn = reinterpret_cast(cc_addr); _Pragma ("GCC diagnostic pop") -- 2.25.1