-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Wmissing variable declaration #4676
Wmissing variable declaration #4676
Conversation
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.
You can apply Niels' suggestion if you wish, but the proper formatting has to be followed to satisfy the CI.
Yeah, we haven't found a way to install old clang-format version 8, so we keep skipping the commit hooks. And newer clang-format makes unrelated changes. There's no magic "Do: reformat" command like with VTK's gitlab? |
Normally, ITK builds the correct version of |
I have
|
Here is the output on my Linux build:
|
Yes, it gets build in the bin directory, under name |
I've just built with |
But grepping |
ece4013
to
acb3c5d
Compare
This is a fix about -Wmissing-variable-declarations warning of clang This is about the static case. A lot of variables were marked as warning due to non declaration. The namespace blocks of code were added when possible to fix. Otherwise it is static.
This is to fix the -Wmissing-variable-declarations warning of clang. This is simply related that the variable in question is not used in the file
acb3c5d
to
d69792e
Compare
@@ -194,7 +194,7 @@ class CallRecord | |||
* Static list of CallRecord items representing the stack trace of | |||
* calls to GenerateData and TemporalStreamingGenerateData | |||
*/ | |||
std::vector<CallRecord> m_CallStack; | |||
static std::vector<CallRecord> m_CallStack; |
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.
It's orthogonal to this change, but this m_CallStack
appears to be a plain old global variable, not a class instance variable. Should it have the m_
prefix?
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.
I guess it should not.
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.
What's the naming convention for plain old global variables then? I don't see the answer here: https://itk.org/Wiki/ITK/Coding_Style_Guide#Naming_Conventions
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.
It should not have the "m_" prefix. It should be included in this PR.
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.
For this one, I decided to keep it static since the variable that is static is used right after and there is no static to that one. I didn't want to let inside a big namespace to complicate more. Is it okay like this or I should create a large namespace?
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.
@andrei-sandor Minor change needed. New static variable should have the m_ removed from the variable name. Will produce a followup PR to remove the m_
916e064
into
InsightSoftwareConsortium:master
@hjmjohnson Yes sure, that's good for me. |
COMP: Fix missing declarations of unused variables.
This is to fix the -Wmissing-variable-declarations warning of clang.
This is simply related that the variable in question is not used in the file
COMP: Fix missing variables declaration (static)
This is a fix about -Wmissing-variable-declarations warning of clang
This is about the static case. A lot of variables were marked as warning due to non declaration. The static keyword was added when it makes sense that the variable is used internally.