public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Christian Convey <cjc@cs.brown.edu> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/10048: Compiler doesn't catch failure to return a value - causes crashing code Date: Wed, 12 Mar 2003 21:36:00 -0000 [thread overview] Message-ID: <20030312213600.30463.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/10048; it has been noted by GNATS. From: Christian Convey <cjc@cs.brown.edu> To: bangerth@dealii.org, cjc@cs.brown.edu, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/10048: Compiler doesn't catch failure to return a value - causes crashing code Date: Wed, 12 Mar 2003 16:30:28 -0500 My apologies for misunderstanding the language. Thanks for your help. - Christian bangerth@dealii.org wrote: > Synopsis: Compiler doesn't catch failure to return a value - causes crashing code > > State-Changed-From-To: open->closed > State-Changed-By: bangerth > State-Changed-When: Wed Mar 12 21:28:41 2003 > State-Changed-Why: > So what is the question? You are falling off the edge of > this function without a proper return statement. The standard > says to this (6.6.3.2): > Flowing off the end of a > function is equivalent to a return with no value; this results in > undefined behavior in a value-returning function > > Undefined behavior is what you get here (a crash). If > you want the compiler to catch this, turn on warnings > which traps here. > > I think there's not much more gcc can do for you here... > > W. > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10048 -- Christian Convey Sr. Software Engineer Computer Science Dept., Brown University
next reply other threads:[~2003-03-12 21:36 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-12 21:36 Christian Convey [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-03-12 21:28 bangerth 2003-03-12 20:36 cjc
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=20030312213600.30463.qmail@sources.redhat.com \ --to=cjc@cs.brown.edu \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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).