From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C415D385B529; Fri, 31 Mar 2023 22:46:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C415D385B529 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680302760; bh=EJ3ZZmaH3l1Irb//gU7w9iwBg+bqYEAt9+/xMI3lJ4g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mGPOYodk5LJqssmNYcSmGWvRMfZIQTnSO4Be8KAy+Xz2ym+7ZdaQdag8UBMwZyDSv fI6S4NB3ba0maF8Hc5/ST7hwxUrHsovTSfaHLTiIfPjq1bExbF1CbHlX54mmCtyzbs bxzYR26pHf48cqNw8C4V5Pv0v8nX9J0/nf24UtpM= From: "contact at thunderperfectwitchcraft dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109364] Missing return statement in a non void function gives only a warning but produces a forced crash. Date: Fri, 31 Mar 2023 22:46:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: contact at thunderperfectwitchcraft dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109364 --- Comment #7 from contact at thunderperfectwitchcraft dot org --- I'm not sure if I understand you correct (as I'm not a native speaker): You= say that it crashes by chance because it is undefined behavior, right? On reddit, I got this as a reply: "I noticed that GCC13 seems to now add a purposeful invalid instruction to functions that have a return type, like Clang does. So your program crashes instead of attempting to continue with some trash return value." Which wouldn't be by chance to my understanding. What is correct?=