-
Notifications
You must be signed in to change notification settings - Fork 465
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
Tighten up warnings #315
Tighten up warnings #315
Conversation
@@ -3207,7 +3218,7 @@ inline void AsyncWorker::OnExecute(napi_env env, void* this_pointer) { | |||
} | |||
|
|||
inline void AsyncWorker::OnWorkComplete( | |||
napi_env env, napi_status status, void* this_pointer) { | |||
napi_env /*env*/, napi_status status, void* this_pointer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to comment out some of the parameter names like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter of a function definition, that is not used in function body generate warning with -Wunused-parameter
enabled.
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Since library is header-only, even function definitions will be compiled with library user (as opposed to library author) flags. If library user has this warning enabled one will get warnings coming from library code, and to fix/hide them one will have to disable warnings for every compilation unit that includes this library, or wrap include with #pragma push-ignore-pop
dance. Or fork/vendor library and fix warnings.
CI run to test across platforms: https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api/653/ |
@@ -40,6 +43,14 @@ namespace details { | |||
return __VA_ARGS__; \ | |||
} | |||
|
|||
// Usually ony could use NAPI_THROW_IF_FAILED(env, status, void()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: How about we re-phrase this to
// We need a _VOID version of this macro to avoid warnings resulting from
// leaving the NAPI_THROW_IF_FAILED `...` argument empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with @gabrielschulhof comment addressed
PR-URL: #315 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Landed in 622ffae. |
PR-URL: nodejs#315 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Since original submit for nodejs#292 warnings were tightened through nodejs#315 causing the bigint test to fail to compile Fix the compile failure
PR-URL: nodejs/node-addon-api#315 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Since original submit for nodejs/node-addon-api#292 warnings were tightened through nodejs/node-addon-api#315 causing the bigint test to fail to compile Fix the compile failure PR-URL: nodejs/node-addon-api#345 Reviewed-By: : None, landed to unbreak CI
PR-URL: nodejs/node-addon-api#315 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Since original submit for nodejs/node-addon-api#292 warnings were tightened through nodejs/node-addon-api#315 causing the bigint test to fail to compile Fix the compile failure PR-URL: nodejs/node-addon-api#345 Reviewed-By: : None, landed to unbreak CI
PR-URL: nodejs/node-addon-api#315 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Since original submit for nodejs/node-addon-api#292 warnings were tightened through nodejs/node-addon-api#315 causing the bigint test to fail to compile Fix the compile failure PR-URL: nodejs/node-addon-api#345 Reviewed-By: : None, landed to unbreak CI
PR-URL: nodejs/node-addon-api#315 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Since original submit for nodejs/node-addon-api#292 warnings were tightened through nodejs/node-addon-api#315 causing the bigint test to fail to compile Fix the compile failure PR-URL: nodejs/node-addon-api#345 Reviewed-By: : None, landed to unbreak CI
This PR enable more warnings in tests and mark them as errors, to ensure that headers would not interfere with build environment of project using this library.