From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5467 invoked by alias); 3 Jul 2002 04:06:05 -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 5421 invoked by uid 71); 3 Jul 2002 04:06:02 -0000 Resent-Date: 3 Jul 2002 04:06:02 -0000 Resent-Message-ID: <20020703040602.5420.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, am-99173@konami.com Received: (qmail 18751 invoked by uid 61); 3 Jul 2002 03:58:34 -0000 Message-Id: <20020703035834.18750.qmail@sources.redhat.com> Date: Tue, 02 Jul 2002 21:06:00 -0000 From: am-99173@konami.com Reply-To: am-99173@konami.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/7189: gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning X-SW-Source: 2002-07/txt/msg00089.txt.bz2 List-Id: >Number: 7189 >Category: optimization >Synopsis: gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Tue Jul 02 21:06:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Honda Hiroki >Release: gcc version 3.1 >Organization: >Environment: i686-pc-linux-gnu >Description: [gcc -O -Wall] reasonably prints a warning message complaining ``control reaches end of non-void function''. [gcc -O2 -Wall] should also print the same warning message. However, [gcc -O2 -Wall] silently succeeds. cd /tmp tar xfz gcc-3.1.tar.gz mkdir /tmp/build mkdir /tmp/experiment cd /tmp/build ../gcc-3.1/configure \ --prefix=/tmp/experiment \ --enable-languages=c make bootstrap make install cd /tmp echo "extern void foo(void);" > chk.c echo "int bar(void) { foo(); }" >> chk.c /tmp/experiment/bin/gcc -S -O -Wall chk.c --> "warning: control reaches end of ..." (correct behavior) /tmp/experiment/bin/gcc -S -O2 -Wall chk.c --> compilation silently succeeds (wrong behavior) >How-To-Repeat: extern void foo(void); int bar(void) { foo(); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: