Skip to content

COMP: Add missing semicolons after ITK macros for ITK6 compat#3

Open
hjmjohnson wants to merge 1 commit into
CSIM-Toolkits:mainfrom
hjmjohnson:itk6-add-semicolons
Open

COMP: Add missing semicolons after ITK macros for ITK6 compat#3
hjmjohnson wants to merge 1 commit into
CSIM-Toolkits:mainfrom
hjmjohnson:itk6-add-semicolons

Conversation

@hjmjohnson
Copy link
Copy Markdown

Adds missing ; after itkNewMacro, itkTypeMacro, itkSetMacro, itkGetMacro calls in IADImageFilter/itkIsotropicAnomalousDiffusionImageFilter.h so the extension builds against ITK upstream main (v6 prep).

Why this is needed

ITK upstream main wraps these macros with ITK_MACROEND_NOOP_STATEMENT, which requires the call site to terminate with ;. ITK ≤ 5.x's macros self-terminated, so the missing ; was tolerated. Adding ; is fully backward compatible with ITK 5.x.

Without this fix, building against ITK upstream main produces:

itkIsotropicAnomalousDiffusionImageFilter.h:35:3: error: expected ';' before 'const'
itkIsotropicAnomalousDiffusionImageFilter.h:37:3: error: expected ';' before 'typedef'
itkIsotropicAnomalousDiffusionImageFilter.h:43:3: error: expected ';' before 'virtual'
Tracking

Part of the Slicer ITK upstream-main (v6) transition tracked at
Slicer/Slicer#9149.
This extension is one of 4 ITK6 regressions whose root cause is missing ; after ITK macros, surfaced by a dual-target ITK 5.4.6 / ITK main extension dashboard.

ITK upstream main (v6 prep) wraps macros like itkSetMacro/itkGetMacro/
itkTypeMacro/itkNewMacro with ITK_MACROEND_NOOP_STATEMENT, which requires
the user's `;` at the call site. ITK 5.x's macros self-terminated, so the
missing `;` was tolerated. Adding `;` is backward-compatible.

Without this fix, building against ITK upstream main produces:
  error: expected ';' before 'const'
  error: expected ';' before 'typedef'
  error: expected ';' before 'virtual'
@hjmjohnson hjmjohnson marked this pull request as ready for review May 11, 2026 14:00
@hjmjohnson
Copy link
Copy Markdown
Author

@acsenrafilho This minor code change makes the code compatible with ITKv6 and is backward compatible with all ITKv5 and ITKv4 versions.

Please merge if you agree with the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant