Hi Craig,
On Mar 3 23:05, Craig Howland wrote:
stdio.h and wchar.h both have unconditional "typedef FILE __FILE"
declarations, which causes GCC to error out if both are included to the same
source, which happens in any number of newlib source files. (For example,
libc/stdlib/btowc.c.)
I'm rather puzzled by this observation. As you may imagine, these files
are used for a long time in packages in the Cygwin distro, and if GCC
would error out in this simple case, we had a lot of complaints from
Cygwin package maintainers. So the first question is, in which scenario
do you see this problem? I created an STC:
--8<---------------cut here---------------start------------->8---
#include <wchar.h>
#include <stdio.h>
extern FILE *foo (FILE *);
int main ()
{
FILE *fp = foo (NULL);
if (fp)
foo (fp);
return 0;
}
--8<---------------cut here---------------end--------------->8---
and gcc -c -g -O2 -Wall does not error out, nor does it even produce
a warning. Same when reordering the includes. Not even with -ansi.