🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #925

gcc doesn't warn about unreachable code

#925
From: J. Scott Hofmann
Date: Tue, 11 Aug 1992 20:59
27 lines
1305 bytes
   In the following short program I have a line which is never reached. gcc
rightly omits the line from the .s file, but does not print a warning that
it is omitting some code, even with -Wall -pedantic.

/* Demonstrate a problem in gcc. Note that printf("two\n") will never be
 * reached.
 */
#include <stdio.h>

void main(void) {
  int i;

  for (i = 1; i < 10; i++) {
    printf("i = %d\n", i);
    continue;
    printf("two\n");
  }
  printf("three\n");
}

                                                       scott

-- 
-------------------------------------------------------------------------------
J. Scott Hofmann                        | "Yes, I am competely loopy."
hofmann@cs.uiuc.edu (NeXTmail accepted) |       -John Cleese
Epoch development team, UIUC            |
Technical Details
Message-ID: <1992Aug11.205904.915@sunb10.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!hofmann

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!hofmann
From: hofmann@cs.uiuc.edu (J. Scott Hofmann)
Subject: gcc doesn't warn about unreachable code
Message-ID: <1992Aug11.205904.915@sunb10.cs.uiuc.edu>
Sender: gnulists@ai.mit.edu
Reply-To: hofmann@cs.uiuc.edu (J. Scott Hofmann)
Organization: Delta group, Dept. of Comp. Sci., University of Illinois at U-C
Distribution: gnu
Date: Tue, 11 Aug 1992 20:59:04 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 28