public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16558] New: 3.5: bogus missing-return warning
@ 2004-07-15  1:55 gcc-bugzilla at gcc dot gnu dot org
  2004-07-15  2:00 ` [Bug middle-end/16558] [3.5 Regression]: " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-07-15  1:55 UTC (permalink / raw)
  To: gcc-bugs



g++ mainline erroneously warns about a missing return for the code below.

$ g++ -c -Wall x.cc
x.cc: In function `int getref(int)':
x.cc:17: warning: control reaches end of non-void function
$

Environment:
System: Linux karma 2.6.7 #18 Wed Jul 14 03:27:01 EDT 2004 i686 i686 i386 GNU/Linux
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/sss/gcc/gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f95

How-To-Repeat:

-----------------------------------------
struct C
{
  C ();
  ~C ();
};

int getref (int ndx)
{
  C d;

  if (ndx != 0) {
    C base;
    return 0;
  }
  else
    return 0;
}
-----------------------------------------
------- Additional Comments From snyder at fnal dot gov  2004-07-15 01:54 -------
Fix:
	<how to correct or work around the problem, if known (multiple lines)>

-- 
           Summary: 3.5: bogus missing-return warning
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: snyder at fnal dot gov
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2005-01-28 17:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-15  1:55 [Bug c++/16558] New: 3.5: bogus missing-return warning gcc-bugzilla at gcc dot gnu dot org
2004-07-15  2:00 ` [Bug middle-end/16558] [3.5 Regression]: " pinskia at gcc dot gnu dot org
2004-07-15  2:02 ` pinskia at gcc dot gnu dot org
2004-07-27 16:29 ` pinskia at gcc dot gnu dot org
2004-09-22 18:36 ` [Bug middle-end/16558] [4.0 " pinskia at gcc dot gnu dot org
2004-10-06 21:00 ` dpatel at apple dot com
2004-11-25 20:37 ` pinskia at gcc dot gnu dot org
2004-12-15 23:45 ` pinskia at gcc dot gnu dot org
2005-01-28  3:48 ` ian at airs dot com
2005-01-28 17:33 ` cvs-commit at gcc dot gnu dot org
2005-01-28 17:34 ` cvs-commit at gcc dot gnu dot org
2005-01-28 17:35 ` ian at airs 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).