Skip to content

Commit

Permalink
STYLE: Use static_assert to check fenv_t members
Browse files Browse the repository at this point in the history
`[[maybe_unused]]` may not need to used in this case.
  • Loading branch information
N-Dekker authored and hjmjohnson committed Jun 11, 2024
1 parent da532bc commit 66d9a73
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Modules/Core/Common/CMake/itkCheckHasFenvtStructMember.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
int
main()
{
[[maybe_unused]] fenv_t fenv;
#if defined(ITK_CHECK_FENV_T_CONTROL)
[[maybe_unused]] const auto tempSize = sizeof(fenv.__control);
static_assert(sizeof(fenv_t().__control) > 0);
#elif defined(ITK_CHECK_FENV_T_CONTROL_WORD)
[[maybe_unused]] const auto tempSize = sizeof(fenv.__control_word);
static_assert(sizeof(fenv_t().__control_word) > 0);
#elif defined(ITK_CHECK_FENV_T_CW)
[[maybe_unused]] const auto tempSize = sizeof(fenv.__cw);
static_assert(sizeof(fenv_t().__cw) > 0);
#else
# error \
"Unknown fenv_t struct member test: Make sure to specify a compile definition of the form -DITK_CHECK_FENV_T_xxx"
Expand Down

0 comments on commit 66d9a73

Please sign in to comment.