You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling the code using -Weverything, clang c++ gives this warning:
./src/woff2_dec.cc:1215:39: warning: variable 'priv_length' may be uninitialized when used here [-Wconditional-uninitialized]
src_offset = Round4(priv_offset + priv_length);
^~~~~~~~~~~
./src/woff2_dec.cc:1095:23: note: initialize the variable 'priv_length' to silence this warning
uint32_t priv_length;
^
= 0
./src/woff2_dec.cc:1205:39: warning: variable 'meta_length' may be uninitialized when used here [-Wconditional-uninitialized]
src_offset = Round4(meta_offset + meta_length);
^~~~~~~~~~~
./src/woff2_dec.cc:1081:23: note: initialize the variable 'meta_length' to silence this warning
uint32_t meta_length;
^
= 0
Changing line 1081 as follows:
uint32_t meta_length = 0;
and line 1095 as follows:
uint32_t priv_length = 0;
silences this warning.
The text was updated successfully, but these errors were encountered:
dejanyy
changed the title
Possibly a flase warning but can't hurt to initialize these 2 variables
Possibly a false warning but can't hurt to initialize these 2 variables
May 22, 2020
Compiling the code using -Weverything, clang c++ gives this warning:
./src/woff2_dec.cc:1215:39: warning: variable 'priv_length' may be uninitialized when used here [-Wconditional-uninitialized]
src_offset = Round4(priv_offset + priv_length);
^~~~~~~~~~~
./src/woff2_dec.cc:1095:23: note: initialize the variable 'priv_length' to silence this warning
uint32_t priv_length;
^
= 0
./src/woff2_dec.cc:1205:39: warning: variable 'meta_length' may be uninitialized when used here [-Wconditional-uninitialized]
src_offset = Round4(meta_offset + meta_length);
^~~~~~~~~~~
./src/woff2_dec.cc:1081:23: note: initialize the variable 'meta_length' to silence this warning
uint32_t meta_length;
^
= 0
Changing line 1081 as follows:
uint32_t meta_length = 0;
and line 1095 as follows:
uint32_t priv_length = 0;
silences this warning.
The text was updated successfully, but these errors were encountered: