From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11854 invoked by alias); 2 Aug 2002 19:06:01 -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 11831 invoked by uid 71); 2 Aug 2002 19:06:01 -0000 Resent-Date: 2 Aug 2002 19:06:01 -0000 Resent-Message-ID: <20020802190601.11830.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, geneing@myrealbox.com Received: (qmail 9649 invoked by uid 61); 2 Aug 2002 18:57:41 -0000 Message-Id: <20020802185741.9648.qmail@sources.redhat.com> Date: Fri, 02 Aug 2002 12:06:00 -0000 From: geneing@myrealbox.com Reply-To: geneing@myrealbox.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/7475: gcc compiles illegal source code without generating any warnings X-SW-Source: 2002-08/txt/msg00038.txt.bz2 List-Id: >Number: 7475 >Category: c >Synopsis: gcc compiles illegal source code without generating any warnings >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Aug 02 12:06:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: geneing@myrealbox.com >Release: 2.95.3 and 3.1 >Organization: >Environment: any >Description: compiler does not warn about illegal code and missing return statements. Attached program is missing a return statement in function foo (for some clauses) and ambiguous declaration of an array in function bar. Neither generates any warnings. >How-To-Repeat: gcc bug.c >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="bug.c" Content-Disposition: inline; filename="bug.c" int bar( void ) { int i,j; int a[i][j]; a[1][2]=5; } int foo( int j ) { if( j == 5 ) return 7; } int main( void ) { bar(); foo( 5 ); foo( 6 ); return 0; }