From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15923 invoked by alias); 14 Sep 2002 08:36:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15902 invoked by uid 71); 14 Sep 2002 08:36:01 -0000 Date: Sat, 14 Sep 2002 01:36:00 -0000 Message-ID: <20020914083601.15895.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Andreas Jaeger Subject: Re: c++/7551: g++ does not mind non-void functions which return n o value. Reply-To: Andreas Jaeger X-SW-Source: 2002-09/txt/msg00322.txt.bz2 List-Id: The following reply was made to PR c++/7551; it has been noted by GNATS. From: Andreas Jaeger To: Tim Barnett Cc: nathan@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/7551: g++ does not mind non-void functions which return n o value. Date: Sat, 14 Sep 2002 10:26:18 +0200 Tim Barnett writes: > Source file consisting of the following two lines: > > int foo(void) { } > int main(void) { return foo(); } > > Gives no warning. Did you use the warning flags? $ /opt/gcc/3.2-devel/bin/gcc t.c -Wall t.c: In function `foo': t.c:1: warning: control reaches end of non-void function $ /opt/gcc/3.2-devel/bin/g++ t.c -Wall t.c: In function `int foo()': t.c:1: warning: control reaches end of non-void function This looks correct to me, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj