Article View: comp.sys.sgi.bugs
Article #27Re: c-compiler false diagnostic.
From: David B.Anderson
Date: Thu, 24 Dec 1992 00:26
Date: Thu, 24 Dec 1992 00:26
33 lines
1621 bytes
1621 bytes
In article <tvk5d44@sgi.sgi.com> davea@quasar.mti.sgi.com (David B.Anderson) writes:
>In article <1992Dec23.163608.24772@bernina.ethz.ch> hoesel@igc.ethz.ch (Frans van Hoesel) writes:
[ ]
>>the c compiler on my indigo (4.0.1) gives the following warning on the
>>following program.
[ ]
>> for (i = 0; i<5; i++ ) printf("%d ", p[i]);
[ ]
>>accom: Warning 302: t4.c, line 8: bodyless for statement
>> ;
>> -^
>>This seems incorrect to me. (the warning I got was the result from some
And you are right.
>The line it shows is, clearly, wrong (the scanner has already gotten to
>the next line by the time the parser has recognized the situation). On
>the other hand, the preceeding for is bodyless.
NO NO NO!
I saw what I expected to see, not what Frans van Hoesel wrote!
There IS NO bodyless for-statement here.
There is no justification for a warning!
What there is is a compiler botch: a variable is not getting reinitialized.
A {} does it, but not a plain statement.
[ So now two botches: misreading the original post plus the compiler is
wrong. ]
My apologies.
[ David B. Anderson (415)390-4263 davea@sgi.com ]
Technical Details
Message-ID:
<tvp8q4o@sgi.sgi.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!sgi!quasar.mti.sgi.com!daveaShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.sgi.bugs Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!sgi!quasar.mti.sgi.com!davea From: davea@quasar.mti.sgi.com (David B.Anderson) Subject: Re: c-compiler false diagnostic. Message-ID: <tvp8q4o@sgi.sgi.com> Sender: davea@quasar.mti.sgi.com Organization: Silicon Graphics, Inc. Mountain View, CA Date: Thu, 24 Dec 1992 00:26:27 GMT Lines: 36