home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: 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
-
- 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?
-
-