Another weird CPP result

Zack Weinberg
Mon Jul 15 23:51:00 GMT 2002

On Tue, Jul 16, 2002 at 07:29:17AM +0100, Neil Booth wrote:
> There is an explicit check for stdout in cpplib to avoid this for that
> one case (cppinit.c:1075).  The problem is to avoid it in general.
> Zack mentioned reworking the code so that cpplib didn't handle opening
> and closing FILE *s, instead the client would just pass them and handle
> the open / close itself.  It hasn't been done yet, though.

I just haven't gotten around to it.  It should get done for 3.3.  Does
it need to be fixed for 3.1.1?  If so I'll bump it up the list.

> I'm still not clear how this solves the problem in general, since
> different paths can refer to the same file.  Under UNIX we can check
> dev/inode pairs, but I'm not aware of a proper portable solution.

You are imagining a situation where, for instance, the -M file and the
normal output are hard or symbolic links to the same inode?  The user
must have done that deliberately; I'm fine with saying that that's not


More information about the Gcc-bugs mailing list