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

Tighten up warnings #315

Closed
wants to merge 4 commits into from
Closed

Conversation

mcheshkov
Copy link
Contributor

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.

@@ -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) {
Copy link
Member

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?

Copy link
Contributor Author

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.

@mhdawson
Copy link
Member

mhdawson commented Sep 6, 2018

@@ -40,6 +43,14 @@ namespace details {
return __VA_ARGS__; \
}

// Usually ony could use NAPI_THROW_IF_FAILED(env, status, void()),
Copy link
Contributor

@gabrielschulhof gabrielschulhof Sep 7, 2018

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.

Copy link
Contributor

@gabrielschulhof gabrielschulhof left a comment

Choose a reason for hiding this comment

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

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 with @gabrielschulhof comment addressed

gabrielschulhof pushed a commit that referenced this pull request Sep 10, 2018
PR-URL: #315
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
@gabrielschulhof
Copy link
Contributor

Landed in 622ffae.

gabrielschulhof pushed a commit to gabrielschulhof/node-addon-api that referenced this pull request Sep 13, 2018
PR-URL: nodejs#315
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
mhdawson added a commit to mhdawson/node-addon-api that referenced this pull request Sep 18, 2018
Since original submit for
nodejs#292 warnings
were tightened through nodejs#315
causing the bigint test to fail to compile

Fix the compile failure
mhdawson added a commit that referenced this pull request Sep 18, 2018
Since original submit for
#292 warnings
were tightened through #315
causing the bigint test to fail to compile

Fix the compile failure

PR-URL: #345
Reviewed-By: : None, landed to unbreak CI
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
PR-URL: nodejs/node-addon-api#315
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
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
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
PR-URL: nodejs/node-addon-api#315
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
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
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
PR-URL: nodejs/node-addon-api#315
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
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
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
PR-URL: nodejs/node-addon-api#315
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants