From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11330 invoked by alias); 2 Apr 2002 03:46: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 11288 invoked by uid 71); 2 Apr 2002 03:46:01 -0000 Date: Mon, 01 Apr 2002 19:46:00 -0000 Message-ID: <20020402034601.11287.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Per Bothner Subject: Re: java/5941: incorrect "Unreachable statement" error Reply-To: Per Bothner X-SW-Source: 2002-04/txt/msg00031.txt.bz2 List-Id: The following reply was made to PR java/5941; it has been noted by GNATS. From: Per Bothner To: tromey@redhat.com Cc: gcc-gnats@gcc.gnu.org Subject: Re: java/5941: incorrect "Unreachable statement" error Date: Mon, 01 Apr 2002 19:46:58 -0800 Tom Tromey wrote: >>>>>>"Eric" == Eric Blake writes: >>>>> > > Eric> for (int i = 0; ; i++) break; > Eric> is legal, even though i++ will never be executed, because i++ is > Eric> not a complete statement and is therefore not subject to the > Eric> rules of JLS 14.20. It any case I think we should emit a warning for this case, since it indicates a bug in the user's code. For the same reason, while emitting an error is technically a bug in the compiler, fixing it seems low-priority. > One approach to fixing it would be to introduce a new FOR tree, which > we could then handle specially in check-init. Then later we would > lower this FOR to a LOOP_EXPR. That sounds reasonable. -- --Per Bothner per@bothner.com http://www.bothner.com/per/