Bug in CPP Causes Duplicate Output Lines (3.3.1/cygming special)

Jim Wilson wilson@specifixinc.com
Sat Jan 10 00:25:00 GMT 2004


Yong Lu wrote:
> 6. The preprocessed file (please see the attachment).  Line 478 in the
>    preprocessed file triggers the 'syntax error'.  Lines 475 to 478
>    are duplicates of lines 462 to 465, and as the result line 478 is
>    incorrectly expanded using a macro definition.

There isn't enough info to fully understand this problem.  You mentioned 
the problem occured while compiling emacs, but you didn't mention the 
emacs version number.  You gave us preprocessed output which shows the 
error, but since the error occurred during preprocessing, we really need 
the original source not the preprocessor output.

However, given the info I have, this doesn't look like a gcc problem. 
These duplicate lines come from <stdio.h>, and if you look at this file, 
it has two declarations for the function fgetchar/fputchar/fdopen.  The 
first one has underscores, the second doesn't.  Apparently, there is a 
header file someone that converted the second into the first via macros.

The problematic line before cpp is
_CRTIMP int __cdecl     fileno (FILE*);
So it appears that there is also a macro somewhere for fileno which 
converts fileno(arg) to (arg)->_file, which gives us the error we see. 
This is perhaps a bug in emacs sources, or perhaps a bug in cygwin, I 
don't have enough info to tell.  I seriously doubt that this is a gcc bug.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc-bugs mailing list