From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2665 invoked by alias); 6 May 2003 11:26:00 -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 2645 invoked by uid 71); 6 May 2003 11:26:00 -0000 Resent-Date: 6 May 2003 11:26:00 -0000 Resent-Message-ID: <20030506112600.2644.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, ikock@artibrain.at Resent-Reply-To: gcc-gnats@gcc.gnu.org, johannes.gajdosik@artibrain.at Received: (qmail 32715 invoked by uid 48); 6 May 2003 11:20:32 -0000 Message-Id: <20030506112032.32714.qmail@sources.redhat.com> Date: Tue, 06 May 2003 11:26:00 -0000 From: johannes.gajdosik@artibrain.at Reply-To: johannes.gajdosik@artibrain.at To: gcc-gnats@gcc.gnu.org Cc: ikock@artibrain.at X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: ikock@artibrain.at Subject: c++/10641: -Wreturn-type does not work reliably X-SW-Source: 2003-05/txt/msg00371.txt.bz2 List-Id: >Number: 10641 >Category: c++ >Synopsis: -Wreturn-type does not work reliably >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Tue May 06 11:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Isabel Kock, Johannes Gajdosik >Release: gcc 2.95.3 >Organization: >Environment: hpux and linux, gcc 2.95.3 > g++ -v Reading specs from /opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.3/specs gcc version 2.95.3 20010315 (release) g++ -v Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs gcc version 2.95.3 20010315 (SuSE) >Description: Even with -Wreturn-type the compiler does not warn when no return value is supplied, see the following example (only 3 lines of code): ---- test.C begin ---- #include int f(string) {} int g(const string &) {} ---- test.C end --- > g++ -c -Wreturn-type test.C test.C: In function `int g(const string &)': test.C:3: warning: control reaches end of non-void function `g(const string &)' The compiler warns about function g, but there is no warning about function f. >How-To-Repeat: See Description >Fix: >Release-Note: >Audit-Trail: >Unformatted: