This is the mail archive of the gcc@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: EOF character in parser


DJ Delorie <dj@redhat.com> writes:

>> This sounds like a C library problem.  The C library should indicate
>> end-of-file when it sees a 0x1a character.  Gcc should not need to
>> check for end-of-file characters, as it uses system calls like read
>> that do it for us.
>
> Note that gcc disables that functionality in libc, so it actually
> does handle the 0x1a itself.

I don't know if this is true or not.  cpplib passes O_BINARY to open()
on systems that define that constant, but the comments in cppfiles.c
claim that this only disables translation of \r\n style line breaks.

There is no special handling of 0x1a in cpplib.

The Fortran, Java, and Ada front ends don't use cpplib so I don't know
what they do.

> Note also that gcc normally uses mmap() to read the file, not read().

No longer true; it caused more trouble than it was worth.

zw


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