Skip to content

Conversation

@danbev
Copy link
Contributor

Currently the following warning is issued when buildning:

Building addon/work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o../test_general.c:116:14: warning: variable 'result' is useduninitialized whenever 'if' condition is false[-Wsometimes-uninitialized] } else if (argument_type == napi_null){ ^~~~~~~~~~~~~~~~~~~~~~~~~~../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~../test_general.c:116:10: note: remove the 'if' if its condition isalways true } else if (argument_type == napi_null){ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../test_general.c:101:20: note: initialize the variable 'result' tosilence this warning napi_value result; ^ = NULL

This commit simply initializes result to NULL to avoid this warning.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
    n-api, test
Affected core subsystem(s)

Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning.
@nodejs-github-botnodejs-github-bot added node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests. labels Jul 6, 2017
@danbev
Copy link
ContributorAuthor

Copy link
Member

@mhdawsonmhdawson left a comment

Choose a reason for hiding this comment

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

LGTM.

@mhdawson
Copy link
Member

I'm thinking this can land without the 48hour wait. Any objections ?

danbev added a commit to danbev/node that referenced this pull request Jul 7, 2017
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. PR-URL: nodejs#14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@danbev
Copy link
ContributorAuthor

Landed in 8f3dab4

@danbevdanbev closed this Jul 7, 2017
@danbevdanbev deleted the napi-test_general-warning branch July 7, 2017 05:27
addaleax pushed a commit that referenced this pull request Jul 11, 2017
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. PR-URL: #14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@addaleaxaddaleax mentioned this pull request Jul 11, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. PR-URL: #14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. PR-URL: #14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 10, 2018
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. PR-URL: nodejs#14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 16, 2018
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null){^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. Backport-PR-URL: #19447 PR-URL: #14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Apr 16, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

node-apiIssues and PRs related to the Node-API.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@danbev@mhdawson@digitalinfinity@addaleax@cjihrig@MylesBorins@nodejs-github-bot