public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114631] New: Inconsistent behavior with infinite loops?
@ 2024-04-07 22:23 kubry at gmx dot com
  2024-04-07 22:26 ` [Bug c++/114631] " kubry at gmx dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: kubry at gmx dot com @ 2024-04-07 22:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114631

            Bug ID: 114631
           Summary: Inconsistent behavior with infinite loops?
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kubry at gmx dot com
  Target Milestone: ---

Dear GCC developers,

First of all, thanks for your work!

This programs works as it is expected (it never stops):

```
#include <iostream>

int main()
{
    double doub;

    // This line caused a «warning: comparing floating point with == or != is
unsafe [-Wfloat-equal]»
    for (doub = 1.1; doub != 1.5; doub = doub + 0.1)
    {
        std::cout << doub << " ";
    }

    // "doubles" are not good enough for this program, the program should not
arrive there
    std::cout << "double is ok." << std::endl;
}
```

however, if we remove the `std::cout << doub << " ";` line... the program stops
(!).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-08 20:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-07 22:23 [Bug c++/114631] New: Inconsistent behavior with infinite loops? kubry at gmx dot com
2024-04-07 22:26 ` [Bug c++/114631] " kubry at gmx dot com
2024-04-07 22:28 ` pinskia at gcc dot gnu.org
2024-04-07 22:31 ` kubry at gmx dot com
2024-04-07 22:39 ` pinskia at gcc dot gnu.org
2024-04-08 20:08 ` kubry at gmx dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).