home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / gcc / bug / 2110 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.2 KB  |  42 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!hofmann
  3. From: hofmann@cs.uiuc.edu (J. Scott Hofmann)
  4. Subject: gcc doesn't warn about unreachable code
  5. Message-ID: <1992Aug11.205904.915@sunb10.cs.uiuc.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: hofmann@cs.uiuc.edu (J. Scott Hofmann)
  8. Organization: Delta group, Dept. of Comp. Sci., University of Illinois at U-C
  9. Distribution: gnu
  10. Date: Tue, 11 Aug 1992 20:59:04 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 28
  13.  
  14.    In the following short program I have a line which is never reached. gcc
  15. rightly omits the line from the .s file, but does not print a warning that
  16. it is omitting some code, even with -Wall -pedantic.
  17.  
  18. /* Demonstrate a problem in gcc. Note that printf("two\n") will never be
  19.  * reached.
  20.  */
  21. #include <stdio.h>
  22.  
  23. void main(void) {
  24.   int i;
  25.  
  26.   for (i = 1; i < 10; i++) {
  27.     printf("i = %d\n", i);
  28.     continue;
  29.     printf("two\n");
  30.   }
  31.   printf("three\n");
  32. }
  33.  
  34.                                                        scott
  35.  
  36. -- 
  37. -------------------------------------------------------------------------------
  38. J. Scott Hofmann                        | "Yes, I am competely loopy."
  39. hofmann@cs.uiuc.edu (NeXTmail accepted) |       -John Cleese
  40. Epoch development team, UIUC            |
  41.  
  42.