public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kubry at gmx dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114631] New: Inconsistent behavior with infinite loops? Date: Sun, 07 Apr 2024 22:23:15 +0000 [thread overview] Message-ID: <bug-114631-4@http.gcc.gnu.org/bugzilla/> (raw) 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 (!).
next reply other threads:[~2024-04-07 22:23 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-07 22:23 kubry at gmx dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114631-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).