Skip to content

Commit

Permalink
STYLE: Do not suppress clang "-Wfloat-equal" inside itkSetObjectMacro
Browse files Browse the repository at this point in the history
The macro definition does not do any floating point comparison.
  • Loading branch information
N-Dekker authored and dzenanz committed Dec 5, 2022
1 parent 2de7e24 commit 10f6e6b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Modules/Core/Common/include/itkMacro.h
Expand Up @@ -1089,7 +1089,6 @@ compilers.
// clang-format on

// clang-format off
// NOTE: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
/** Set pointer to object; uses Object reference counting methodology.
* Creates method Set"name"() (e.g., SetPoints()). Note that using
* smart pointers requires using real pointers when setting input,
Expand All @@ -1098,14 +1097,11 @@ compilers.
virtual void Set##name(type * _arg) \
{ \
itkDebugMacro("setting " << #name " to " << _arg); \
CLANG_PRAGMA_PUSH \
CLANG_SUPPRESS_Wfloat_equal \
if (this->m_##name != _arg) \
{ \
this->m_##name = _arg; \
this->Modified(); \
} \
CLANG_PRAGMA_POP \
} \
ITK_MACROEND_NOOP_STATEMENT
// clang-format on
Expand Down

0 comments on commit 10f6e6b

Please sign in to comment.