Skip to content

Commit

Permalink
test: suppress compiler warning in test_bigint
Browse files Browse the repository at this point in the history
Currently the are two of following compiler warnings is
generated:

In file included from ../test_bigint.c:5:
../test_bigint.c: In function ‘CreateTooBigBigInt’:
../test_bigint.c:120:22: warning:
‘words’ may be used uninitialized [-Wmaybe-uninitialized]

This commit initialized the words array to avoid these warnings.

PR-URL: #40253
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev committed Oct 1, 2021
1 parent 1e89238 commit 35dc386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/js-native-api/test_bigint/test_bigint.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static napi_value TestWords(napi_env env, napi_callback_info info) {
static napi_value CreateTooBigBigInt(napi_env env, napi_callback_info info) {
int sign_bit = 0;
size_t word_count = SIZE_MAX;
uint64_t words[10];
uint64_t words[10] = {0};

napi_value output;

Expand All @@ -125,7 +125,7 @@ static napi_value CreateTooBigBigInt(napi_env env, napi_callback_info info) {

// Test that we correctly forward exceptions from the engine.
static napi_value MakeBigIntWordsThrow(napi_env env, napi_callback_info info) {
uint64_t words[10];
uint64_t words[10] = {0};
napi_value output;

napi_status status = napi_create_bigint_words(env,
Expand Down

0 comments on commit 35dc386

Please sign in to comment.