Skip to content

COMP: Fix missing initialization braces warning#2756

Merged
jhlegarreta merged 1 commit intoInsightSoftwareConsortium:masterfrom
jhlegarreta:FixMissingInitializationBracesWarning
Sep 24, 2021
Merged

COMP: Fix missing initialization braces warning#2756
jhlegarreta merged 1 commit intoInsightSoftwareConsortium:masterfrom
jhlegarreta:FixMissingInitializationBracesWarning

Conversation

@jhlegarreta
Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta commented Sep 24, 2021

Fix missing initialization braces warning.

Fixes:

[CTest: warning matched]
/Users/builder/externalModules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx:29:37:
warning: suggest braces around initialization of subobject [-Wmissing-braces]
  p_image->SetRegions(itk::Size<3>{ 0, 0, 0 });
                                    ^~~~~~~
                                    {      }
[CTest: warning suppressed] 1 warning generated.

and

[CTest: warning matched]
/Users/builder/externalModules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx:62:36:
warning: suggest braces around initialization of subobject [-Wmissing-braces]
  itk::Vector<float, 2> spacin{ { 0.5, 5.0 } };
                                  ^~~~~~~~
                                  {       }
[CTest: warning suppressed] 1 warning generated.

reported at:
https://open.cdash.org/viewBuildError.php?type=1&buildid=7475017

PR Checklist

@github-actions github-actions Bot added area:Filtering Issues affecting the Filtering module type:Compiler Compiler support or related warnings type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct labels Sep 24, 2021
@jhlegarreta
Copy link
Copy Markdown
Member Author

Looks like #2748 did not make one of the compilers happy.

I am not being able to configure ITK locally due to some CMake error, so I cannot test locally if this compiles (at least on Windows).

@seanm can you please check that this makes happy RogueResearch7 ? Thanks.

Comment thread Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx Outdated
@seanm
Copy link
Copy Markdown
Contributor

seanm commented Sep 24, 2021

That warning is pretty useless, and I've tried to disable it, see here:

https://open.cdash.org/build/7475017/notes

note presence of -Wno-missing-braces. I'm stumped why it doesn't work...

@jhlegarreta jhlegarreta force-pushed the FixMissingInitializationBracesWarning branch from c22f0c9 to 3265872 Compare September 24, 2021 15:57
Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, but this is about pleasing the compilers 😄

Comment thread Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx Outdated
Fix missing initialization braces warning.

Fixes:
````
[CTest: warning matched]
/Users/builder/externalModules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx:29:37:
warning: suggest braces around initialization of subobject [-Wmissing-braces]
  p_image->SetRegions(itk::Size<3>{ 0, 0, 0 });
                                    ^~~~~~~
                                    {      }
[CTest: warning suppressed] 1 warning generated.
```

and
```
[CTest: warning matched]
/Users/builder/externalModules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx:62:36:
warning: suggest braces around initialization of subobject [-Wmissing-braces]
  itk::Vector<float, 2> spacin{ { 0.5, 5.0 } };
                                  ^~~~~~~~
                                  {       }
[CTest: warning suppressed] 1 warning generated.
```

reported at:
https://open.cdash.org/viewBuildError.php?type=1&buildid=7475017
@jhlegarreta jhlegarreta force-pushed the FixMissingInitializationBracesWarning branch from 3265872 to 33d1d0d Compare September 24, 2021 16:16
@jhlegarreta
Copy link
Copy Markdown
Member Author

The CircleCI build is expected to fail due to the know issues in the Review module. Cross-referencing #2567 (comment).

@jhlegarreta jhlegarreta merged commit 9def6b7 into InsightSoftwareConsortium:master Sep 24, 2021
@jhlegarreta jhlegarreta deleted the FixMissingInitializationBracesWarning branch September 24, 2021 22:42
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request May 6, 2026
…xMissingInitializationBracesWarning

COMP: Fix missing initialization braces warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module type:Compiler Compiler support or related warnings type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants