Repository navigation
Compiler warnings make test-linux workflow fail on v14.x #38718
Copy link
Copy link
Closed
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.
Description
Activity
- addedc++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.
on May 18, 2021 ../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 errorsInteresting. I do not see any errors with GCC 8.4 (CentOS 8)
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).
- added a commit that references this issue
on May 19, 2021 - added a commit that references this issue
on May 25, 2021 - added a commit that references this issue
on May 31, 2021 - added 2 commits that reference this issue
on Jun 5, 2021 - added a commit that references this issue
on May 22, 2026
Metadata
Metadata
Assignees
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.
For example: https://github.com/nodejs/node/runs/2607695302?check_suite_focus=true
Some notes:
master--error-on-warnwas backported to v14.3.0 so this is probably a regression in one of the commits that were backported to v14.17.