Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unnecessary double promotion generate warning. #2820

Closed
SvenJo opened this issue Feb 21, 2024 · 0 comments · Fixed by #2821
Closed

unnecessary double promotion generate warning. #2820

SvenJo opened this issue Feb 21, 2024 · 0 comments · Fixed by #2821

Comments

@SvenJo
Copy link
Contributor

SvenJo commented Feb 21, 2024

Describe the bug
Small MPUs have limited floating point units, for this reason we avoid double promotion.
If we try to compile Catch2 in our build pipeline with -Werror and -Wdouble-promotion, the build will fail.

Expected behavior

Catch2 should compile without warnings, helpful in the embedded world.

Reproduction steps

Compile Catch with GCC 12.3.0:

/home/sven/work/Universal-LED-Driver/build-presets/EmulationDev/_deps/catch2-src/src/catch2/catch_approx.cpp: In constructor ‘Catch::Approx::Approx(double)’:
/home/sven/work/Universal-LED-Driver/build-presets/EmulationDev/_deps/catch2-src/src/catch2/catch_approx.cpp:28:57: warning: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Wdouble-promotion]
   28 |     :   m_epsilon( std::numeric_limits<float>::epsilon()*100. ),

Platform information:

  • OS: Linux
  • Compiler+version: GCC v12.3.0
  • Catch version: v3.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants