Skip to content
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

COMP: Gcc13.2 compiler warnings #4637

Merged

Conversation

hjmjohnson
Copy link
Member

Fix compiler warnings issues with python building turned on.

PR Checklist

@hjmjohnson hjmjohnson added the type:Compiler Compiler support or related warnings label May 2, 2024
@hjmjohnson hjmjohnson added this to the ITK 5.4.0 milestone May 2, 2024
@hjmjohnson hjmjohnson requested a review from thewtex May 2, 2024 20:41
@hjmjohnson hjmjohnson self-assigned this May 2, 2024
@github-actions github-actions bot added area:Core Issues affecting the Core module area:Segmentation Issues affecting the Segmentation module labels May 2, 2024
@hjmjohnson hjmjohnson force-pushed the gcc13.2-compiler-warnings branch from eda087b to 3edf0fa Compare May 2, 2024 20:59
@hjmjohnson hjmjohnson added the action:ApplyClangFormat Add this label to a pull request to apply `clang-format` to the branch label May 2, 2024
@hjmjohnson
Copy link
Member Author

I ran all 3 files through the clang-format-Darwin binary from the build tree, but there are no changes identified.

I don't know how to fix the CI errors that are posted.

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

💚

@thewtex
Copy link
Member

thewtex commented May 2, 2024

@hjmjohnson please rebase for style fixes

@hjmjohnson hjmjohnson force-pushed the gcc13.2-compiler-warnings branch from 3edf0fa to 3a0fc51 Compare May 3, 2024 12:35
@hjmjohnson
Copy link
Member Author

/azp ITK.macOS.Arm64

@hjmjohnson hjmjohnson force-pushed the gcc13.2-compiler-warnings branch from 3a0fc51 to 5cd6c52 Compare May 5, 2024 12:47
@thewtex
Copy link
Member

thewtex commented May 6, 2024

todo: rebase on #4642 after merged.

@thewtex thewtex force-pushed the gcc13.2-compiler-warnings branch from 5cd6c52 to e1c5d05 Compare May 7, 2024 14:48
hjmjohnson added 4 commits May 8, 2024 08:39
ITK/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx: In member function ‘ThreadedAllocateData’:
ITK/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx:789:49: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  789 |   m_Data[ThreadId].m_LoadTransferBufferLayers = new LayerListType[2 * m_NumberOfLayers + 1];
      |                                                 ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
ITK/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx: In member function ‘ThreadedAllocateData’:
ITK/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx:789:49: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  789 |   m_Data[ThreadId].m_LoadTransferBufferLayers = new LayerListType[2 * m_NumberOfLayers + 1];
      |                                                 ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |
Limit possible index overflow.

In member function ‘SetVnlVector’,
    inlined from ‘_wrap_itkVectorUC2_SetVnlVector’ at ITK/cmake-build-release/Wrapping/Modules/ITKCommon/itkVectorPython.cpp:31005:0:
ITK/Modules/Core/Common/include/itkVector.hxx:160: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  160 |     (*this)[i] = v(i);
      |
ITK/Modules/Core/Common/include/itkFixedArray.h: In function ‘_wrap_itkVectorUC2_SetVnlVector’:
ITK/Modules/Core/Common/include/itkFixedArray.h:437:10: note: at offset 2 into destination object ‘m_InternalArray’ of size 2
  437 |   CArray m_InternalArray;
      |          ^
Initialize the memory to zeros upon allocation.

Avoid initialization followed by assignment to zero.
@hjmjohnson hjmjohnson force-pushed the gcc13.2-compiler-warnings branch from e1c5d05 to e64032a Compare May 8, 2024 13:44
@hjmjohnson
Copy link
Member Author

@thewtex The failing test is unstable, and has nothing to do with the PR.

This test is unstable Failed

It seems like perhaps the CI does not have access to the file, or the file is corrupt. I don't know how to proceed.

@hjmjohnson
Copy link
Member Author

/azp ITK.macOS.Arm64

@thewtex
Copy link
Member

thewtex commented May 13, 2024

@hjmjohnson patch for the Nifti tests here: #4659

@thewtex thewtex merged commit cdc28b0 into InsightSoftwareConsortium:master May 14, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action:ApplyClangFormat Add this label to a pull request to apply `clang-format` to the branch area:Core Issues affecting the Core module area:Segmentation Issues affecting the Segmentation module type:Compiler Compiler support or related warnings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants