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
{{ message }}
Repository navigation
Compiler warnings make test-linux workflow fail on v14.x #38718
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::UTF8]’:
../src/node_buffer.cc:665:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
665 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:662:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
662 | size_t max_length;
| ^~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::ASCII]’:
../src/node_buffer.cc:665:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
665 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:662:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
662 | size_t max_length;
| ^~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::BASE64]’:
../src/node_buffer.cc:665:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
665 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::BINARY]’:
../src/node_buffer.cc:665:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
665 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::HEX]’:
../src/node_buffer.cc:665:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
665 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:662:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
662 | size_t max_length;
| ^~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::UCS2]’:
../src/node_buffer.cc:665:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
665 | if (offset > ts_obj_length) {
| ^~
cc1plus: all warnings being treated as errors
make[2]: *** [libnode.target.mk:345: /home/runner/work/node/node/out/Release/obj.target/libnode/src/node_buffer.o] Error 1
make[2]: *** Waiting for unfinished jobs....
I see similar errors locally (Fedora 33 with gcc/g++ 10) with master.
Details
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::Fill(const v8::FunctionCallbackInfo<v8::Value>&)’:
../src/node_buffer.cc:646:35: error: ‘start’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
646 | char* ptr = ts_obj_data + start + str_length;
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::ASCII]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::BASE64]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::BASE64URL]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:672:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
672 | size_t max_length;
| ^~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::BINARY]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:672:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
672 | size_t max_length;
| ^~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::HEX]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::UCS2]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:672:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
672 | size_t max_length;
| ^~~~~~~~~~
../src/node_buffer.cc: In function ‘void node::Buffer::{anonymous}::StringWrite(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding encoding = node::UTF8]’:
../src/node_buffer.cc:675:3: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
675 | if (offset > ts_obj_length) {
| ^~
../src/node_buffer.cc:672:10: error: ‘max_length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
672 | size_t max_length;
| ^~~~~~~~~~
cc1plus: all warnings being treated as errors
On CentOS Stream release 8 I do not get errors with either the default GCC 8.4 or GCC 9.2 (via gcc-toolset-9) but do get them with GCC 10.2 (gcc-toolset-10).
Activity
targos commentedon May 18, 2021
richardlau commentedon May 18, 2021
I see similar errors locally (Fedora 33 with gcc/g++ 10) with master.
Details
targos commentedon May 19, 2021
Interesting. I do not see any errors with GCC 8.4 (CentOS 8)
richardlau commentedon May 19, 2021
On CentOS Stream release 8 I do not get errors with either the default GCC 8.4 or GCC 9.2 (via gcc-toolset-9) but do get them with GCC 10.2 (gcc-toolset-10).
src: fix compiler warnings in node_buffer.cc
src: fix compiler warnings in node_buffer.cc
src: fix compiler warnings in node_buffer.cc
src: fix compiler warnings in node_buffer.cc
src: fix compiler warnings in node_buffer.cc
src: fix compiler warnings in node_buffer.cc