From 3c187d3eec67c379dd6458e0b78166f7662d1f95 Mon Sep 17 00:00:00 2001 From: Axel Garcia Date: Thu, 18 Jun 2026 09:55:07 +0200 Subject: [PATCH] COMP: Hide warning message "format not a string literal" --- include/rtkIterationCommands.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/rtkIterationCommands.h b/include/rtkIterationCommands.h index 88d7ed5cc..30f1d28c9 100644 --- a/include/rtkIterationCommands.h +++ b/include/rtkIterationCommands.h @@ -157,8 +157,15 @@ class ITK_TEMPLATE_EXPORT OutputIterationCommand : public IterationCommand; auto writer = WriterType::New(); - char buffer[1024]; + char buffer[1024]; +#if defined(__GNUC__) || defined(__clang__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif unsigned int size = snprintf(buffer, 1024, m_FileFormat.c_str(), this->m_IterationCount); +#if defined(__GNUC__) || defined(__clang__) +# pragma GCC diagnostic pop +#endif writer->SetFileName(std::string(buffer, size)); writer->SetInput(caller->GetOutput());