From e43d0d326228eaf6ad9b6de36e49fc2c127b0fb7 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 3 Sep 2024 15:28:54 +0000 Subject: [PATCH 1/2] build: turn off -Wrestrict --- node.gyp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node.gyp b/node.gyp index fb8c02c86dcc83..2d13a75b929269 100644 --- a/node.gyp +++ b/node.gyp @@ -478,12 +478,13 @@ # Putting these explicitly here so not to depend on `common.gypi`. # `common.gypi` need to be more general because it is used to build userland native addons. # Refs: https://github.com/nodejs/node-gyp/issues/1118 - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-restrict', ], 'xcode_settings': { 'WARNING_CFLAGS': [ '-Wall', '-Wendif-labels', '-W', + '-Wno-restrict', '-Wno-unused-parameter', '-Werror=undefined-inline', '-Werror=extra-semi', From 2cfbcb47f69980f44a75906eba72cb61f9e94b09 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 3 Sep 2024 15:44:41 +0000 Subject: [PATCH 2/2] fixup! build: turn off -Wrestrict --- node.gyp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/node.gyp b/node.gyp index 2d13a75b929269..c64e2768198453 100644 --- a/node.gyp +++ b/node.gyp @@ -478,13 +478,12 @@ # Putting these explicitly here so not to depend on `common.gypi`. # `common.gypi` need to be more general because it is used to build userland native addons. # Refs: https://github.com/nodejs/node-gyp/issues/1118 - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-restrict', ], + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], 'xcode_settings': { 'WARNING_CFLAGS': [ '-Wall', '-Wendif-labels', '-W', - '-Wno-restrict', '-Wno-unused-parameter', '-Werror=undefined-inline', '-Werror=extra-semi', @@ -492,6 +491,9 @@ }, 'conditions': [ + ['clang==0 and OS!="win"', { + 'cflags': [ '-Wno-restrict', ], + }], # Pointer authentication for ARM64. ['target_arch=="arm64"', { 'target_conditions': [