home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / bugs / 39 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.5 KB  |  47 lines

  1. Newsgroups: comp.sys.sgi.bugs
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!sgi!quasar.mti.sgi.com!davea
  3. From: davea@quasar.mti.sgi.com (David B.Anderson)
  4. Subject: Re: c-compiler false diagnostic.
  5. Message-ID: <tvp8q4o@sgi.sgi.com>
  6. Sender: davea@quasar.mti.sgi.com
  7. Organization: Silicon Graphics, Inc.  Mountain View, CA
  8. Date: Thu, 24 Dec 1992 00:26:27 GMT
  9. Lines: 36
  10.  
  11. In article <tvk5d44@sgi.sgi.com> davea@quasar.mti.sgi.com (David B.Anderson) writes:
  12. >In article <1992Dec23.163608.24772@bernina.ethz.ch> hoesel@igc.ethz.ch (Frans van Hoesel) writes:
  13. [ ]
  14. >>the c compiler on my indigo (4.0.1) gives the following warning on the
  15. >>following program.
  16. [ ]
  17. >>        for (i = 0; i<5; i++ ) printf("%d ", p[i]);
  18. [ ]
  19. >>accom: Warning 302: t4.c, line 8: bodyless for statement
  20. >>        ;
  21. >>       -^
  22. >>This seems incorrect to me. (the warning I got was the result from some
  23.  
  24. And you are right.
  25.  
  26. >The line it shows is, clearly, wrong (the scanner has already gotten to
  27. >the next line by the time the parser has recognized the situation).  On
  28. >the other hand, the preceeding for is bodyless.
  29.  
  30. NO NO NO!
  31.     I saw what I expected to see, not what Frans van Hoesel wrote!
  32.  
  33. There IS NO bodyless for-statement here.
  34. There is no justification for a warning!
  35.  
  36. What there is is a compiler botch: a variable is not getting reinitialized.
  37. A {} does it, but not a plain statement.
  38.  
  39. [ So now two botches:  misreading the original post plus the compiler is 
  40.   wrong.                                  ]
  41.  
  42. My apologies.   
  43. [ David B. Anderson             (415)390-4263             davea@sgi.com ]
  44.  
  45.  
  46.  
  47.