home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: 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
-
- 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 |
-
-