Skip to content

Commit

Permalink
Fix for gcc-12 maybe-uninitialized warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey authored Mar 29, 2023
1 parent fd273ea commit 90f3f06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Src/FEMTree.IsoSurface.specialized.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ protected:
const typename SliceData::SquareCornerIndices& idx = sValues.sliceData.cornerIndices( node );
Real x0 = sValues.cornerValues[idx[c0]] , x1 = sValues.cornerValues[idx[c1]];
Point< Real , Dim > s;
Real start , width;
Real start = 0 , width; // initialize start to prevent -Wmaybe-uninitialized
tree._startAndWidth( node , s , width );
int o;
{
Expand Down
2 changes: 1 addition & 1 deletion Src/RegularTree.inl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int RegularTreeNode< Dim , NodeData , DepthAndOffsetType >::maxDepth(void) const
if( !children ) return 0;
else
{
int c , d;
int c = 0 , d; // initialize start to prevent -Wmaybe-uninitialized
for( int i=0 ; i<(1<<Dim) ; i++ )
{
d = children[i].maxDepth();
Expand Down

0 comments on commit 90f3f06

Please sign in to comment.