This is the mail archive of the
mailing list for the GCC project.
Re: EOF character in parser
> Given that O_BINARY has been in cpplib's open() call since 3.0 and no
> one has complained about 0x1a not being treated as EOF yet, I am not
> inclined to do anything about it.
> However, now that we are no longer using mmap to read the file, the
> O_BINARY might be unnecessary, and removing it would eliminate this
> potential issue.
I suspect that the CR/LF autoconversion will eventually cause
problems. The usual problem is that read() returns a short read, and
you can't easily tell EOF from cr/lf effects. Plus, bare CRs may be
stripped in text mode. I recommend keeping O_BINARY.