🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sgi.bugs
1 messages
1 total messages Started by David B.Anderson Thu, 24 Dec 1992 00:26
Re: c-compiler false diagnostic.
#27
Author: David B.Anderson
Date: Thu, 24 Dec 1992 00:26
33 lines
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 ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads