From b180512aef7349a10a3fe8e5cca81cdc13e57f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 9 Jan 2024 10:50:57 +0100 Subject: [PATCH] tools: do not pass invalid flag to C compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `-Wno-invalid-offsetof` is only valid for C++ and GCC warns about its usage for C. PR-URL: https://github.com/nodejs/node/pull/51409 Reviewed-By: Jiawen Geng Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen Reviewed-By: Benjamin Gruenbaum --- tools/v8_gypfiles/v8.gyp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 4d69a59fcbc5b5..bc6aaf40fe585b 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1989,6 +1989,12 @@ ] }], ], + # -Wno-invalid-offsetof flag is not valid for C. + # The flag is initially set in `toolchain.gypi` for all targets. + 'cflags!': [ '-Wno-invalid-offsetof' ], + 'xcode_settings': { + 'WARNING_CFLAGS!': ['-Wno-invalid-offsetof'] + }, 'direct_dependent_settings': { 'include_dirs': [ '<(V8_ROOT)/third_party/zlib',