From 5a689b62bc752f03db7f8ee4ead86ae5836ef9df Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 6 Oct 2021 09:06:36 +0200 Subject: [PATCH 1/2] deps: suppress zlib compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, there are a number of compilation warnings from zlib like the following one: ../deps/zlib/infback.c: In function ‘inflateBack’: ../deps/zlib/infback.c:479:25: warning: this statement may fall through [-Wimplicit-fallthrough=] 479 | state->mode = LEN; | ~~~~~~~~~~~~^~~~~ ../deps/zlib/infback.c:481:9: note: here 481 | case LEN: | ^~~~ In this case there is no break statement and the intention is to fall through: Tracev((stderr, "inflate: codes ok\n")); state->mode = LEN; case LEN: This commit adds -Wno-implicit-fallthrough' to zlib.gyp to suppress these warnings. --- deps/zlib/zlib.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index bbfb561b89b52f..6c1e6b65849c9f 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -51,6 +51,7 @@ '.', ], }, + 'cflags': [ '-Wno-implicit-fallthrough' ], 'conditions': [ ['OS!="win"', { 'cflags!': [ '-ansi' ], From 9f53d9ab898babfc5383744ac673ab05e53f862a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 11 Oct 2021 08:07:02 +0200 Subject: [PATCH 2/2] squash! deps: suppress zlib compiler warnings Move cflags into conditions section and only enable for non-windows architectures. --- deps/zlib/zlib.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index 6c1e6b65849c9f..7cc472d63ad056 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -51,10 +51,10 @@ '.', ], }, - 'cflags': [ '-Wno-implicit-fallthrough' ], 'conditions': [ ['OS!="win"', { 'cflags!': [ '-ansi' ], + 'cflags': [ '-Wno-implicit-fallthrough' ], 'defines': [ 'HAVE_HIDDEN' ], }], ['OS=="mac" or OS=="ios" or OS=="freebsd" or OS=="android"', {