This means that we no longer need to build with -Wno-invalid-offsetof.
# Linux (GCC). Note with GCC 5.x/6.x you must use the old ABI, with GCC 7.x you must use
# the new ABI. See BUILD file for more information.
CXX=g++
-CXXOPTS=-D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++11 -Os -Wall -Wno-invalid-offsetof -fno-rtti
+CXXOPTS=-D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++11 -Os -Wall -fno-rtti
EXTRA_LIBS=
BUILD_SHUTDOWN=yes
SANITIZEOPTS=-fsanitize=address,undefined
static rearm control_conn_cb(eventloop_t * loop, control_conn_watcher * watcher, int revents)
{
+ // 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<char *>(watcher)) - offsetof(control_conn_t, iob);
control_conn_t *conn = reinterpret_cast<control_conn_t *>(cc_addr);
+ _Pragma ("GCC diagnostic pop")
+
if (revents & IN_EVENTS) {
if (conn->data_ready()) {
delete conn;