This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Always pass an open file descriptor toc_common_read_pch


Ritzert@t-online.de writes:

>> instead.  Actually, I don't think this assertion is necessary; the
>> fatal error after fdopen fails is good enough.
>
> It was convinient for me to have this. I stripped out this very small
> testcase from a rather big one that produced loads of warnings after
> the fdopen error and somewhat obscured my view.

Sorry, I misread the code and thought it used fatal_error, which it
doesn't.  A patch to change the calls to cpp_errno in
c_common_read_pch to fatal_error would be acceptable.

>> I don't think this is right either.  Your test case does not
>> involve PCH; we should not be going through this code path at all.
>
> I couldn't reproduce the error without using PCH, i.e. omitting the g++
> -c x.h step.

Ah, sorry, again I misunderstood.  Still, I think that reopening the
file is not the right fix.  Rather, an instruction to read the same
PCH file twice should be ignored.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]