public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "davek at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/42674]  New: Bogus "no return statement in function returning non-void" warning
Date: Sat, 09 Jan 2010 19:10:00 -0000	[thread overview]
Message-ID: <bug-42674-14373@http.gcc.gnu.org/bugzilla/> (raw)

Simple testcase not even worth attaching preprocessed source for, using
HEAD@155680.  Note that this only arises in C++, not when compiled as C:

------------------------------------------------------------------------
$ cat badwarn.cpp

extern void bar (void);
int foo (void) __attribute__ ((__noreturn__));

int
foo (void)
{
  while (1)
  {
    bar ();
  }
}

$ g++-4 -c badwarn.cpp  -Wall
badwarn.cpp: In function 'int foo()':
badwarn.cpp:12:1: warning: no return statement in function returning non-void
------------------------------------------------------------------------

Discussed on the list at http://gcc.gnu.org/ml/gcc/2010-01/threads.html#00180;
Ross Smith identified this as a regression as it does not arise with 4.0.1,
4.2.1 and 4.3.4, and HJ tracked it to r.138140:

http://gcc.gnu.org/ml/gcc-cvs/2008-07/msg00852.html


-- 
           Summary: Bogus "no return statement in function returning non-
                    void" warning
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davek at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42674


             reply	other threads:[~2010-01-09 19:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-09 19:10 davek at gcc dot gnu dot org [this message]
2010-01-09 20:49 ` [Bug middle-end/42674] [4.5 Regression] " hjl dot tools at gmail dot com
2010-01-10 22:08 ` [Bug middle-end/42674] [4.4/4.5 " rguenth at gcc dot gnu dot org
2010-01-11  0:24 ` davek at gcc dot gnu dot org
2010-01-11 18:18 ` manu at gcc dot gnu dot org
2010-01-11 19:08 ` davek at gcc dot gnu dot org
2010-01-13 17:38 ` jakub at gcc dot gnu dot org
2010-01-13 18:07 ` jakub at gcc dot gnu dot org
2010-01-14 16:38 ` rguenth at gcc dot gnu dot org
2010-01-14 22:44 ` jakub at gcc dot gnu dot org
2010-01-14 22:50 ` jakub at gcc dot gnu dot org
2010-01-14 23:20 ` jakub at gcc dot gnu dot org

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-42674-14373@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: link
Be 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).