This is the mail archive of the
cygwin
mailing list for the Cygwin project.
New gcc-4 compile error w/getc and isspace
- From: Vin Shelton <acs at xemacs dot org>
- To: cygwin at cygwin dot com
- Date: Sun, 08 Nov 2009 23:43:41 -0500
- Subject: New gcc-4 compile error w/getc and isspace
Consider this module:
#include <stdio.h>
#include <ctype.h>
void
tst(FILE *fp)
{
int c;
while ( isspace(c = getc(fp)) )
;
return;
}
gcc-4 -c t2.c
t2.c: In function ‘tst’:
t2.c:9: error: lvalue required as left operand of assignment
I'm pretty sure this module used to compile successfully under gcc-4,
but I recently rebuilt my machine, so something may have changed in the
configuration.
gcc-3 compiles the module without complaint.
gcc-4 will compile this version:
#include <stdio.h>
#include <ctype.h>
void
tst(FILE *fp)
{
int c;
//while ( isspace(c = getc(fp)) )
while ( c = getc(fp) && isspace(c) )
;
return;
}
Did something recently change in the ctype.h or stdio.h header files to
cause this?
Regards,
Vin
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple