🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1372

gcc 2.3.1 warning bug?

#1372
From: Rush Record 713-864-1574
Date: Thu, 12 Nov 1992 04:35
27 lines
1025 bytes
The following program was compiled with gcc on a sparc II running
SunOS 4.1.1, using gcc version 2.3.1, compiled by itself, as follows:

gcc -Wall -c test.c

#include <stdio.h>
int main(char *buf)
{
	char c,*p;

	p = buf;
	while(c = *p++)
		printf("%c",c);
	return(1);
}

The result was:

test.c: In function `main':
test.c:7: warning: suggest parentheses around assignment used as truth value
test.c:8: warning: implicit declaration of function `printf'

There are already parentheses around the assignment. Must I use:

	while((c = *p++))
	
everywhere in my code?
Technical Details
Message-ID: <009637a2.7a8a1de0.2253@clio.rice.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!clio.rice.edu!rhr

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!clio.rice.edu!rhr
From: rhr@clio.rice.edu (Rush Record 713-864-1574)
Subject: gcc 2.3.1 warning bug?
Message-ID: <009637a2.7a8a1de0.2253@clio.rice.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 12 Nov 1992 04:35:48 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 28