Skip to content

Commit

Permalink
COMP: Fix for gcc13.2 compiler test failures
Browse files Browse the repository at this point in the history
Three tests fail in ITK for Release and RelWithDebInfo builds
on Ubuntu 24.04 with GCC 13.2:

```txt
itkGDCMLegacyMultiFrameTest (Failed)
itkGDCMImageReadWriteTest_MultiFrameMRIZSpacing (Failed)
itkGDCM_ComplianceTest_singlebit (Failed)
```

(Note: Debug builds do not fail these tests)

The initial review of the code did not indicate a problem, but it looks
like perhaps an over-optimization that removes variables and causes the
incorrect behavior to occur.

The function "FindDataElement" had duplicate code from "GetDataElement"
so made "FindDataElement" use the "GetDataElement" working function.
  • Loading branch information
hjmjohnson authored and malaterre committed May 3, 2024
1 parent 76164e0 commit 680810f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Source/DataStructureAndEncodingDefinition/gdcmDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,9 @@ class GDCM_EXPORT DataSet

// DUMB: this only search within the level of the current DataSet
bool FindDataElement(const Tag &t) const {
const DataElement r(t);
//ConstIterator it = DES.find(r);
if( DES.find(r) != DES.end() )
{
return true;
}
return false;
const auto it = GetDataElement(t);
// Return if tag is found
return it != GetDEEnd();
}

// WARNING:
Expand Down

0 comments on commit 680810f

Please sign in to comment.