Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url: build warning fixes #10141

Closed
wants to merge 2 commits into from
Closed

Conversation

brodycj
Copy link

@brodycj brodycj commented Dec 6, 2016

Checklist
  • make -j8 test (UNIX [macOS]; Linux i386 & amd64) and vcbuild test nosign (.\vcbuild.bat nosign then .\vcbuild.bat test nosign nobuild as Administrator on Windows) PASS OK
  • commit message follows commit guidelines
Additional item
Affected core subsystem(s)

url

Description of change

Christopher J. Brody added 2 commits December 6, 2016 14:58
This is to resolve an unused result warning in node_url.cc.
Resolve macro redefinition warning on Windows
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Dec 6, 2016
@brodycj
Copy link
Author

brodycj commented Dec 6, 2016

NOTE: This was originally a part of PR #10139.

@addaleax addaleax added url Issues and PRs related to the legacy built-in url module. lts-watch-v4.x labels Dec 6, 2016
@@ -62,7 +62,7 @@ using v8::Value;
url.flags |= URL_FLAGS_TERMINATED; \
goto done; \
}
#define FAILED() \
#define URL_FAILED() \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just an #undef FAILED? It would decrease churn in the code below.

@brodycj
Copy link
Author

brodycj commented Dec 6, 2016 via email

@sam-github
Copy link
Contributor

OK, I'm fine with the macro rename. LGTM

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brodycj
Copy link
Author

brodycj commented Dec 7, 2016

Thanks guys!

@brodycj
Copy link
Author

brodycj commented Dec 8, 2016

I realized the following change in #10145 should have been part of this PR to resolve a conversion warning on the Windows build:

diff --git a/src/node_url.cc b/src/node_url.cc
index 7502461..b048449 100644
--- a/src/node_url.cc
+++ b/src/node_url.cc
@@ -341,7 +341,8 @@ namespace url {
       val = numbers[parts - 1];
       for (int n = 0; n < parts - 1; n++) {
         double b = 3-n;
-        val += numbers[n] * pow(256, b);
+        // TBD POSSIBLE DATA LOSS:
+        val += static_cast<uint32_t>(numbers[n] * pow(256, b));
       }
     }
 

I would be happy to take one of the following actions:

  1. combine with 5906faa ("url: mark ignored return value in node::url::Parse(...)") and rebase along with 9695066 (fix src/node_url.cc to resolve the macro redefinition warning on Windows)
  2. add a new commit with this fix to this PR without rebasing
  3. open a new PR to resolve the conversion warning on Windows

@sam-github @addaleax @mhdawson please let me know which action I should take. Thanks!

@addaleax
Copy link
Member

addaleax commented Dec 8, 2016

I don’t think there’s any semantic relation to any of the commits in this PR, so feel free to open a new one

@jasnell
Copy link
Member

jasnell commented Dec 23, 2016

jasnell pushed a commit that referenced this pull request Dec 27, 2016
This is to resolve an unused result warning in node_url.cc.
Resolve macro redefinition warning on Windows

PR-URL: #10141
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
@jasnell
Copy link
Member

jasnell commented Dec 27, 2016

Landed in 595b22a

@jasnell jasnell closed this Dec 27, 2016
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
This is to resolve an unused result warning in node_url.cc.
Resolve macro redefinition warning on Windows

PR-URL: #10141
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
This is to resolve an unused result warning in node_url.cc.
Resolve macro redefinition warning on Windows

PR-URL: #10141
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
@MylesBorins
Copy link
Contributor

This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport

@TimothyGu TimothyGu added the whatwg-url Issues and PRs related to the WHATWG URL implementation. label Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. url Issues and PRs related to the legacy built-in url module. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants