Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Rush Record 713-864-1574
Thu, 12 Nov 1992 04:35
gcc 2.3.1 warning bug?
Author: Rush Record 713-864-1574
Date: Thu, 12 Nov 1992 04:35
Date: Thu, 12 Nov 1992 04:35
27 lines
1025 bytes
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?
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