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
Marking unused code #4661
Merged
Merged
Marking unused code #4661
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was that a "multiline comment" warning? I always wondered why that would be a compiler warning.. to me, it's kinda a case in point that we shouldn't use
-WAll/Extra
at all and instead choose the few compiler warnings we actually want to care about. there's many very good ones, but this isn't one of them IMHO.that would also solve the annoying thing where we semi-regularly break the
-WAll
CI builds because some compiler update introduced some esoteric new warning which we then have to comply with.it's just unfortunately a serious PITA to write out all interesting warnings.. on top of that clang & gcc here and there have different names for the same warning! thanks for that..
so yeah, in summary, I just wanna express how much I loathe these nonsense warnings 😄 I do understand why you do
if 0
(easy to grep, won't be compiled) and it makes sense here instead of removing it seems, reading the comment. I still hope that we don't have to do those changes too muchThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my two cents: i hate this convention 😄
there is nothing wrong with commenting something out. if the compiler is warning about this then as nils said we have it configured wrong. this is just way way too pedantic to be reasonable. can we avoid doing more of this?
if we desperately want to use the preprocessor to disable this code we should define a macro for tests to use like
NON_WORKING_TEST_CODE
or something. the idea with these things are kind of like the author leaving a sketch of something that is TODOs but isnt ready yet. havingifdef 0
looks more like stuff you leave around while developing but want to actually delete before you PR the change