Skip to content

src: fix `-Wshadow` warning

In utils.h's ERROR_AND_ABORT macro, rename the static local variable args to avoid -Wshadow warnings in code that calls ERROR_AND_ABORT(). This allows Electron to remove a patch.

Relevant console output:

In file included from ../../third_party/electron_node/src/inspector/runtime_agent.cc:3:
In file included from ../../third_party/electron_node/src/env-inl.h:32:
../../third_party/electron_node/src/node_internals.h:72:3: error: declaration shadows a local variable [-Werror,-Wshadow]
   72 |   CHECK(args[0]->IsObject());
      |   ^
../../third_party/electron_node/src/util.h:154:7: note: expanded from macro 'CHECK'
  154 |       ERROR_AND_ABORT(expr);                                                  \
      |       ^
../../third_party/electron_node/src/util.h:132:38: note: expanded from macro 'ERROR_AND_ABORT'
  132 |     static const node::AssertionInfo args = {                                 \
      |                                      ^
../../third_party/electron_node/src/node_internals.h:67:67: note: previous declaration is here
   67 | void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>& args) {
      |                                                                   ^
1 error generated.

Merge request reports

Loading