-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCC warnings when compiling files in src #26733
Comments
https://gist.github.com/refack/1cc202e9b507d63d108d5ba55293e540 with 167 warnings from MSVC |
PR-URL: nodejs#26735 Refs: nodejs#26733 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
PR-URL: nodejs#26735 Refs: nodejs#26733 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
PR-URL: nodejs#26766 Ref nodejs#26733 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@targos is this still an issue? |
@cjihrig Yes, I can still reproduce all warnings from the OP with GCC 8 and 9. |
@targos |
@targos hi. Can you describe the steps to reproduce these notifications? |
@bmsdave Hello. I can reproduce the warnings on my system (Fedora 30, GCC 9.2.1) with:
I removed the other two warnings from the OP because I can't reproduce them anymore. |
just wondering between this and #18983 , are we talking about the same thing? |
It doesn't look like the same thing. |
Not sure we can do anything about the rest of them: The The |
Turn the `strategy_` method pointer into an enum-based static dispatch. It's both safer and more secure (no chance of method pointer corruption) and it helps GCC see that the shift and suffix tables it's complaining about are unused in single char search mode. Fixes the following warning: ../src/string_search.h:113:30: warning: ‘search’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (this->*strategy_)(subject, index); Fixes: nodejs#26733 Fixes: nodejs#31532 Fixes: nodejs#31798
Turn the `strategy_` method pointer into an enum-based static dispatch. It's both safer and more secure (no chance of method pointer corruption) and it helps GCC see that the shift and suffix tables it's complaining about are unused in single char search mode. Fixes the following warning: ../src/string_search.h:113:30: warning: ‘search’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (this->*strategy_)(subject, index); Fixes: #26733 Refs: #31532 Refs: #31798 PR-URL: #31809 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Turn the `strategy_` method pointer into an enum-based static dispatch. It's both safer and more secure (no chance of method pointer corruption) and it helps GCC see that the shift and suffix tables it's complaining about are unused in single char search mode. Fixes the following warning: ../src/string_search.h:113:30: warning: ‘search’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (this->*strategy_)(subject, index); Fixes: #26733 Refs: #31532 Refs: #31798 PR-URL: #31809 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
I don't know if they are all fixable, but the first one is very annoying because it is emitted for (almost?) each C++ file:
The text was updated successfully, but these errors were encountered: