Skip to content

Commit

Permalink
Suppress MSVC warning in unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Eichelberg committed Mar 6, 2024
1 parent f8e6414 commit 5f59183
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ofstd/include/dcmtk/ofstd/diag/unarymin.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Clang and GCC don't seem to have such a warning
#ifdef _MSC_VER
#pragma warning(disable: 4146)
#endif
10 changes: 9 additions & 1 deletion ofstd/include/dcmtk/ofstd/ofdiag.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (C) 2016-2023, OFFIS e.V.
* Copyright (C) 2016-2024, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
Expand Down Expand Up @@ -239,6 +239,13 @@
*/
#define DCMTK_DIAGNOSTIC_IGNORE_ARRAY_BOUNDS <unspecified>

/*! @brief A macro to disable warnings about the use of the unary minus
* operator with an unsigned integer type
* @note The macro may only be used in conjunction with <i>#include</i>!
* @see DCMTK_DIAGNOSTIC_PUSH for an example.
*/
#define DCMTK_DIAGNOSTIC_IGNORE_UNSIGNED_UNARY_MINUS <unspecified>

#else // DOXYGEN

#define DCMTK_DIAGNOSTIC_PUSH "dcmtk/ofstd/diag/push.def"
Expand Down Expand Up @@ -266,6 +273,7 @@
#define DCMTK_DIAGNOSTIC_IGNORE_RESTRICT "dcmtk/ofstd/diag/restrict.def"
#define DCMTK_DIAGNOSTIC_IGNORE_USE_AFTER_FREE "dcmtk/ofstd/diag/useafree.def"
#define DCMTK_DIAGNOSTIC_IGNORE_ARRAY_BOUNDS "dcmtk/ofstd/diag/arrybnds.def"
#define DCMTK_DIAGNOSTIC_IGNORE_UNSIGNED_UNARY_MINUS "dcmtk/ofstd/diag/unarymin.def"

// readable shorthands for compiler version checks
#define DCMTK_DIAGNOSTIC_MIN_GCC_VERSION(MAJOR, MINOR, PATCH)\
Expand Down
3 changes: 2 additions & 1 deletion ofstd/tests/tlimits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
#include "dcmtk/ofstd/ofmath.h" // for isinf and isnan

// On some platforms, such as OpenIndiana, isinf is defined as a macro,
// and that inteferes with the OFMath function of the same name.
// and that interferes with the OFMath function of the same name.
#ifdef isinf
#undef isinf
#endif

#include DCMTK_DIAGNOSTIC_PUSH
#include DCMTK_DIAGNOSTIC_IGNORE_OVERFLOW
#include DCMTK_DIAGNOSTIC_IGNORE_IMPLICIT_CONVERSION
#include DCMTK_DIAGNOSTIC_IGNORE_UNSIGNED_UNARY_MINUS
template<typename T>
static void checkMinMax()
{
Expand Down

0 comments on commit 5f59183

Please sign in to comment.