Uh oh!
There was an error while loading. Please reload this page.
url: build warning fixes - #10141
Conversation
This is to resolve an unused result warning in node_url.cc.
Resolve macro redefinition warning on Windows
brody2consult
commented
Dec 6, 2016
NOTE: This was originally a part of PR #10139. |
| goto done; \ | ||
| } | ||
| #define FAILED() \ | ||
| #define URL_FAILED() \ |
There was a problem hiding this comment.
How about just an #undef FAILED? It would decrease churn in the code below.
brody2consult
commented
Dec 6, 2016
via email
In src/node_url.cc:
> @@ -62,7 +62,7 @@ using v8::Value; url.flags |= URL_FLAGS_TERMINATED; \ goto done; \ } -#define FAILED() \ +#define URL_FAILED() \
How about just an #undef FAILED? It would decrease churn in the code below.
Thanks @addaleax and @sam-github for the feedback!
+1 for touching less code.
In general: I don't really like undefining and redefining macros since the
meaning changes depending on what part of the code it is in. I think this
is an ugly solution for an ugly problem. -1
I would personally favor reducing the ugliness here by using something like
URL_FAILED.
I would like to leave this open for any other comments and would like to
follow a majority opinion from Node.js owners here. Hoping to avoid excess
bikeshedding. |
sam-github
commented
Dec 6, 2016
OK, I'm fine with the macro rename. LGTM |
brody2consult
commented
Dec 7, 2016
Thanks guys! |
brody2consult
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:
@sam-github@addaleax@mhdawson please let me know which action I should take. Thanks! |
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
commented
Dec 23, 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 <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
jasnell
commented
Dec 27, 2016
Landed in 595b22a |
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 <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
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 <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
MylesBorins
commented
Jan 23, 2017
This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport |
Checklist
make -j8 test(UNIX [macOS]; Linux i386 & amd64) andvcbuild test nosign(.\vcbuild.bat nosignthen.\vcbuild.bat test nosign nobuildas Administrator on Windows) PASS OKAdditional item
Affected core subsystem(s)
url
Description of change