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

Yong Lu lyongu+@cs.cmu.edu
Wed Jan 14 11:24:00 GMT 2004


>>>>> "Jim" == Jim Wilson <wilson@specifixinc.com> writes:


    > 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

Thanks for your reply.

I checked the headers and you were right that 'fileno' was define'd elsewhere.
There's a line in a header that comes with emacs (ms-w32.h)

#define fileno    _fileno

and this in turn was expanded to ((FILE*)->_file), and triggered the
error.

- Yong



More information about the Gcc-bugs mailing list