Skip to content

build: fix GCC warnings when building V8 with gnu++20 - #67279

Open
joyeecheung wants to merge 1 commit into
nodejs:mainfrom
joyeecheung:fix-warning
Open

joyeecheung wants to merge 1 commit into
nodejs:mainfrom
joyeecheung:fix-warning

Conversation

@joyeecheung

Copy link
Copy Markdown
Member

This silences the following warning from GCC:

  • deps/v8/src/base/flags.h: call to non-constexpr function std::__atomic_base<unsigned char>::operator unsigned char() const in the defaulted constexpr Flags::operator== when instantiated with std::atomic<uint8_t> storage [-Winvalid-constexpr]
  • deps/v8/include/v8-wasm.h: call to non-constexpr function std::unique_ptr<const unsigned char[]>::get() const in constexpr OwnedBuffer::as_span() [-Winvalid-constexpr]
  • deps/v8/src/execution/simulator.h: ‘nodebug’ attribute directive ignored [-Wattributes]

Also move -fvisibility-inlines-hidden from cflags to cflags_cc in tools/v8_gypfiles/v8.gyp to fix the following warning.

cc1: warning: command-line option '-fvisibility-inlines-hidden' is
valid for C++/ObjC++ but not for C

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency. labels Nov 5, 2026
This silences the following warning from GCC:

- deps/v8/src/base/flags.h: call to non-constexpr function
  `std::__atomic_base<unsigned char>::operator unsigned char() const`
  in the defaulted `constexpr Flags::operator==` when instantiated
  with `std::atomic<uint8_t>` storage [-Winvalid-constexpr]
- deps/v8/include/v8-wasm.h: call to non-constexpr function
  `std::unique_ptr<const unsigned char[]>::get() const` in
  `constexpr OwnedBuffer::as_span()` [-Winvalid-constexpr]
- deps/v8/src/execution/simulator.h: ‘nodebug’ attribute directive
  ignored [-Wattributes]

Also move -fvisibility-inlines-hidden from cflags to cflags_cc in
tools/v8_gypfiles/v8.gyp to fix the following warning.

  cc1: warning: command-line option '-fvisibility-inlines-hidden' is
  valid for C++/ObjC++ but not for C

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
@joyeecheung

Copy link
Copy Markdown
Member Author

cc @nodejs/build @nodejs/v8-update

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 6, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 6, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants