Skip to content

Commit

Permalink
COMP: suppress format string is not a string literal warning
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp authored and hjmjohnson committed Dec 5, 2024
1 parent 39f5687 commit d6ce189
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Modules/IO/TIFF/src/itkTIFFReaderInternal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ itkTIFFErrorHandlerExtR([[maybe_unused]] TIFF * tif,
if (::itk::Object::GetGlobalWarningDisplay() && !self->m_ErrorSilence)
{
char out[256];
ITK_GCC_PRAGMA_PUSH
ITK_GCC_SUPPRESS_Wformat_nonliteral;
vsnprintf(out, 256, fmt, ap);
ITK_GCC_PRAGMA_POP
std::ostringstream itkmsg;
itkmsg << "ERROR: libtiff(" << (module ? module : "") << ") message: " << out << std::endl;
::itk::OutputWindowDisplayErrorText(itkmsg.str().c_str());
Expand All @@ -69,7 +72,10 @@ itkTIFFWarningHandlerExtR([[maybe_unused]] TIFF * tif,
if (::itk::Object::GetGlobalWarningDisplay() && !self->m_WarningSilence)
{
char out[256];
ITK_GCC_PRAGMA_PUSH
ITK_GCC_SUPPRESS_Wformat_nonliteral;
vsnprintf(out, 256, fmt, ap);
ITK_GCC_PRAGMA_POP
std::ostringstream itkmsg;
itkmsg << "WARNING: libtiff(" << (module ? module : "") << ") message: " << out << std::endl;
::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str());
Expand Down

0 comments on commit d6ce189

Please sign in to comment.