src: initialize pid variable before goto by nornagon · Pull Request #22961 · nodejs/node

@nornagon

This fixes an error when compiling with clang-cl on Windows:

```
src/node.cc(2437,5):  error: jump from this goto statement to its label is a Microsoft extension [-Werror,-Wmicrosoft-goto]
    goto out;
    ^
src/node.cc(2441,9):  note: jump bypasses variable initialization
  DWORD pid = args[0].As<Integer>()->Value();
        ^
```

@nodejs-github-bot added the c++

Issues and PRs that require attention from people who are familiar with C++.

label

Sep 19, 2018

lundibundi

nornagon added a commit to electron/node that referenced this pull request

Sep 19, 2018

nornagon added a commit to electron/node that referenced this pull request

Sep 19, 2018

tniessen

richardlau

addaleax

@addaleax addaleax added windows

Issues and PRs related to the Windows platform.

lib / src

Issues and PRs related to general changes in the lib or src directory.

fast-track

PRs that do not need to wait for 72 hours to land.

author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

labels

Sep 20, 2018

joyeecheung

addaleax pushed a commit that referenced this pull request

Sep 20, 2018
This fixes an error when compiling with clang-cl on Windows:

```
src/node.cc(2437,5):  error: jump from this goto statement to its label is a Microsoft extension [-Werror,-Wmicrosoft-goto]
    goto out;
    ^
src/node.cc(2441,9):  note: jump bypasses variable initialization
  DWORD pid = args[0].As<Integer>()->Value();
        ^
```

PR-URL: #22961
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

targos pushed a commit that referenced this pull request

Sep 21, 2018
This fixes an error when compiling with clang-cl on Windows:

```
src/node.cc(2437,5):  error: jump from this goto statement to its label is a Microsoft extension [-Werror,-Wmicrosoft-goto]
    goto out;
    ^
src/node.cc(2441,9):  note: jump bypasses variable initialization
  DWORD pid = args[0].As<Integer>()->Value();
        ^
```

PR-URL: #22961
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

codebytere pushed a commit to electron/node that referenced this pull request

Oct 2, 2018

This was referenced

Oct 10, 2018

This was referenced

Oct 11, 2018