InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

COMP: Suppress `-Wformat-nonliteral` warning in diff tensor example #4631

Closed jhlegarreta closed 2 months ago

jhlegarreta commented 2 months ago

Suppress -Wformat-nonliteral warning in diffusion tensor reconstruction image filter example.

Fixes:

[CTest: warning matched]
 /Users/builder/externalExamples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx:254:46:
 warning: format string is not a string literal [-Wformat-nonliteral]
        snprintf(filename, sizeof(filename), fn.c_str(), referenceImageIndex);
                                             ^~~~~~~~~~
[CTest: warning matched]
 /Users/builder/externalExamples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx:260:46:
 warning: format string is not a string literal [-Wformat-nonliteral]
        snprintf(filename, sizeof(filename), fn.c_str(), i);
                                             ^~~~~~~~~~
[CTest: warning suppressed] 2 warnings generated.

raised for example in: https://open.cdash.org/viewBuildError.php?type=1&onlydeltap&buildid=9582771

Left behind in commit 001a1a7.

PR Checklist

N-Dekker commented 2 months ago

ITK.macos (https://open.cdash.org/viewBuildError.php?buildid=9584061) says:

Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx#L254:9: error: unknown type name 'ITK_GCC_PRAGMA_PUSH'

🤷 (But also please check my "inline" comments!)