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