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] Fix pch failures when opening a header that has been precompiled multiple times (PR pch/13675)



On 31/03/2008, at 7:10 AM, Jakub Jelinek wrote:
Hi!

When a header file is included multiple times and has been precompiled,
gcc fails with error: calling fdopen: Bad file descriptor.
The problem is that file->fd is closed after cb.read_pch and set to -1,
so the next time should_stack_file is called on it, c_common_read_pch
which starts with fdopen (fd, "rb"); really has to fail.
The fix below clears pch (and frees pchname) once the *.gch file
is read using cb.read_pch, which means that an include file won't be
handled as a PCH file in the second and following #include (which matches
the PCH design).

So that's what was going on! Thanks for debugging this.


Ok for trunk?

I see Tom has already approved the files.c parts. The c-pch.c changes are OK too.


Attachment: smime.p7s
Description: S/MIME cryptographic signature


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