home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / 18492 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.5 KB

  1. Path: sparky!uunet!olivea!sgigate!sgi!quasar.mti.sgi.com!davea
  2. From: davea@quasar.mti.sgi.com (David B.Anderson)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Rules for naked ";" in ANSI "C"?
  5. Message-ID: <ugj33og@sgi.sgi.com>
  6. Date: 5 Jan 93 18:24:07 GMT
  7. Sender: davea@quasar.mti.sgi.com
  8. Organization: Silicon Graphics, Inc.  Mountain View, CA
  9. Lines: 30
  10.  
  11. In article <255@trident.datasys.swri.edu> noren@trident.datasys.swri.edu (Greg Noren) writes:
  12. >I turned -fullwarn on some "C" code I was ANSIfying and tangled
  13. >with a bothersome warning from cc().  Take a look at the
  14. >following test program derived from the code in question.
  15.  
  16. >    for ( i = 0; i < 6; i++ )
  17. >        printf( "Hello, world %d\n", i );
  18. >
  19. >    D(printf("END TEST\n"));
  20. >----------
  21. >Compiling with:  "cc -o test -ansi -fullwarn test.c" produces
  22. >an executable which runs correctly and the following accom
  23. >warning for the "D(printf...);" macro line:
  24. >
  25. >accom: Warning 302: test.c, line 17: bodyless for statement
  26.  
  27. Yes, this is a bug in accom.   As Dave Olson said in another
  28. posting, -woff 302 will eliminate the warning.
  29.  
  30. Or you can work around the bug by coding:
  31.      for ( i = 0; i < 6; i++ ){
  32.          printf( "Hello, world %d\n", i );
  33.      }
  34.  
  35. In the absence of braces, accom sometimes gives an incorrect 
  36. warning about "bodyless" something-or-other.   Looking
  37. at the accom source, this botch is (now) painfully obvious.
  38.  
  39. Thanks for reporting the bug.
  40. [ David B. Anderson             (415)390-4263             davea@sgi.com ]
  41.