Skip to content

src: use CHECK(false) in switch default case - #26502

Closed
nitsakh wants to merge 6 commits into
nodejs:masterfrom
nitsakh:check-no-string
Closed

src: use CHECK(false) in switch default case#26502
nitsakh wants to merge 6 commits into
nodejs:masterfrom
nitsakh:check-no-string

Conversation

@nitsakh

@nitsakhnitsakh commented Mar 7, 2019

Copy link
Copy Markdown
Contributor

Passing a !string to CHECK will trigger a string conversion warning and it's also inconsistent with the usage in other places. Hence, this changes it to CHECK(false) making it consistent.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. labels Mar 7, 2019
Comment threadsrc/node_crypto.cc Outdated
Comment threadsrc/node_crypto.cc Outdated
nitsakh added a commit to electron/node that referenced this pull request Mar 8, 2019
@nitsakh

Copy link
Copy Markdown
ContributorAuthor

Thanks! I just updated the branch as per @bnoordhuis 's suggestion. Please let me know if this approach works.

@nitsakh

nitsakh commented Mar 8, 2019

Copy link
Copy Markdown
ContributorAuthor

Maybe the build is failing on gcc4.9 due to https://github.com/nodejs/node/blob/master/src/node_file.h#L151-L156 ? 🤔

Comment threadsrc/util.h Outdated
@danbev

Copy link
Copy Markdown
Contributor

@nitsakh

nitsakh commented Mar 14, 2019

Copy link
Copy Markdown
ContributorAuthor

UNREACHABLE is called in a template definition (here), and static cannot be used inside a constexpr function. Hence, I changed the static const to constexpr for definition of node::AssertionInfo args in the ERROR_AND_ABORT macro (it's better to indicate constexpr to the compiler anyway).
This, I think, is causing the failure on gcc4.9, because we are redefining constexpr for gcc4.9 here.
I'm opting to change the declaration to const, I think that'll fine™.

@danbev

Copy link
Copy Markdown
Contributor

bnoordhuis
bnoordhuis previously requested changes Mar 15, 2019
Comment threadsrc/util.h Outdated
Comment threadsrc/util.h Outdated
@refack

refack commented Mar 19, 2019

Copy link
Copy Markdown
Contributor

@nitsakh

Copy link
Copy Markdown
ContributorAuthor

@bnoordhuis, it'll be great if you can please take a quick look at the changes.

codebytere pushed a commit to electron/node that referenced this pull request Mar 20, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 22, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 25, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 25, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 26, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 26, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 26, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 26, 2019
nitsakh added a commit to electron/node that referenced this pull request Mar 26, 2019
nitsakh added a commit to electron/node that referenced this pull request Apr 11, 2019
zcbenz pushed a commit to electron/node that referenced this pull request Apr 16, 2019
zcbenz pushed a commit to electron/node that referenced this pull request Apr 16, 2019
@nitsakh

Copy link
Copy Markdown
ContributorAuthor

Please let me know if there's something blocking here. Happy to make needed changes. :-)

@addaleax
addaleax dismissed bnoordhuis’s stale reviewApril 17, 2019 17:49

has been addressed

@addaleaxaddaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. lib / src Issues and PRs related to general changes in the lib or src directory. and removed crypto Issues and PRs related to the crypto subsystem. labels Apr 17, 2019
@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

@ryzokuken

Copy link
Copy Markdown
Contributor

1 similar comment
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleax

Copy link
Copy Markdown
Member

Sorry this took so long! Landed in 00ba75e 🎉

addaleax pushed a commit that referenced this pull request May 19, 2019
PR-URL: #26502
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
targos pushed a commit that referenced this pull request May 20, 2019
PR-URL: #26502
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@BridgeARBridgeAR mentioned this pull request May 21, 2019
4 tasks
codebytere pushed a commit to electron/node that referenced this pull request Jun 20, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@nitsakh@danbev@refack@BridgeAR@nodejs-github-bot@ryzokuken@addaleax@sam-github@bnoordhuis