-fno-finite-math-only leaves __FINITE_MATH_ONLY__ defined
Open
Nobody has claimed this yet.
clang:driver
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Minimal reproducible example:
int main()
{
#ifdef __FINITE_MATH_ONLY__
#error __FINITE_MATH_ONLY__ defined
#endif
return 0;
}
Command line:
\installed\LLVM-23.1.0-win64\bin\clang++ -ffast-math -fno-finite-math-only bug.cpp
Output:
bug.cpp:4:6: error: __FINITE_MATH_ONLY__ defined
4 | #error __FINITE_MATH_ONLY__ defined
| ^
1 error generated.
Expected output:
No error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproducer in bug.cpp and run the reported clang++ command using -ffast-math and -fno-finite-math-only. Trace how these options define FINITE_MATH_ONLY; done means the macro is not defined and the reproducer compiles without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100