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

Wunused macros #4673

Merged

Conversation

andrei-sandor
Copy link
Contributor

@andrei-sandor andrei-sandor commented May 16, 2024

COMP: Fix unused macros related to MSVC and OS

This is to fix the -Wunused-macros generated by clang for macros related to MSVC and Microsoft.

For itkNumericTraitsTest.cxx, the _MSC_VER is added to respect the comment.

For itkTestDriver.cxx, ITK_TEST_DRIVER_PATH_SLASH / is related to non Windows machine and there is none in the code and hence it is removed. Now, for ITK_TEST_DRIVER_PATH_SLASH \, it is not found in the entire code. This is the reason why it is removed.


COMP: Fix unused general macros

This is to fix the -Wunused-macros warning from clang. This is about fixing general macros used in the code.

In the commit, the macros are removed. However, I am wondering if we should comment them since someone might use them in the future.


COMP: Fixed unused legacy remove Macros

This is a commit to solve the Wunused-macros warning generated by clang related to ITK_LEGACY_REMOVE macro.

The change is to create an ifnded macro with it even if ITK_LEGACY_REMOVE is not used in the file. In itkConfigue.h, ITK_LEGACY_REMOVE is defined there if the code is in the legacy remove scenario or not. We need to keep ITK_LEGACY_REMOVE to create a flag that the code is legacy.

@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:IO Issues affecting the IO module area:Segmentation Issues affecting the Segmentation module labels May 16, 2024
@andrei-sandor andrei-sandor force-pushed the WunusedMacros branch 3 times, most recently from 560800e to d69739d Compare May 29, 2024 00:48
This is a commit to solve the Wunused-macros warning generated by clang related to ITK_LEGACY_REMOVE macro.

The change is to create an ifnded macro with it even if ITK_LEGACY_REMOVE is not used in the file. In itkConfigue.h, ITK_LEGACY_REMOVE is defined there if the code is in the legacy remove scenario or not. We need to keep ITK_LEGACY_REMOVE to create a flag that the code is legacy.
@andrei-sandor andrei-sandor force-pushed the WunusedMacros branch 2 times, most recently from 3ecc085 to cc4b585 Compare May 30, 2024 13:51
@seanm
Copy link
Contributor

seanm commented May 30, 2024

/azp.run ITK.Linux

This is to fix the -Wunused-macros warning from clang. This is about fixing general macros used in the code.

In the commit, the macros are removed. However, I am wondering if we should comment them since someone might use them in the future.
This is to fix the -Wunused-macros generated by clang for macros related to MSVC and Microsoft.

For itkNumericTraitsTest.cxx, the _MSC_VER is added to respect the comment.

For itkTestDriver.cxx, ITK_TEST_DRIVER_PATH_SLASH / is related to non Windows machine and there is none in the code and hence it is removed. Now, for ITK_TEST_DRIVER_PATH_SLASH \\, it is not found in the entire code. This is the reason why it is removed.
@hjmjohnson hjmjohnson merged commit b6ab07f into InsightSoftwareConsortium:master May 31, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module area:IO Issues affecting the IO module area:Segmentation Issues affecting the Segmentation module 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.

None yet

4 participants