src: fix compiler warnings in node_buffer.cc#38722
Closed
RaisinTen wants to merge 1 commit intonodejs:masterfrom
Closed
src: fix compiler warnings in node_buffer.cc#38722RaisinTen wants to merge 1 commit intonodejs:masterfrom
RaisinTen wants to merge 1 commit intonodejs:masterfrom
Conversation
Member
|
Any idea why the warnings are only emitted on v14.x branches? |
Member
|
/cc @addaleax ? |
This comment has been minimized.
This comment has been minimized.
targos
approved these changes
May 19, 2021
richardlau
reviewed
May 19, 2021
Member
richardlau
left a comment
There was a problem hiding this comment.
This PR has cleared up most of the compiler warnings I get when building locally with GCC 10 (#38718 (comment)) but one still remains:
../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;
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: nodejs#38718
15303b2 to
2ab4e90
Compare
This comment has been minimized.
This comment has been minimized.
Member
Author
|
@richardlau Updated the PR to initialize |
richardlau
approved these changes
May 19, 2021
jasnell
approved these changes
May 19, 2021
JungMinu
approved these changes
May 21, 2021
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
Member
|
Landed in 7766b38 |
jasnell
pushed a commit
that referenced
this pull request
May 24, 2021
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: #38718 PR-URL: #38722 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos
pushed a commit
that referenced
this pull request
May 25, 2021
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: #38718 PR-URL: #38722 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
danielleadams
pushed a commit
that referenced
this pull request
May 31, 2021
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: #38718 PR-URL: #38722 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Merged
targos
pushed a commit
that referenced
this pull request
Jun 5, 2021
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: #38718 PR-URL: #38722 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jun 11, 2021
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: #38718 PR-URL: #38722 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The variables could be initialized to
0to avoid the warnings from-Wmaybe-uninitialized.Fixes: #38718