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]

Re: Null characters in files


On Tue, Apr 04, 2000 at 12:09:28AM +0900, Neil Booth wrote:
> Since my patch of about a week ago which removed the special meaning
> of null characters from read_and_prescan, null characters no longer
> mangle, but get passed straight through to the lexer.
> 
> With this patch null characters are handled as follows:-
> 
> o  Embedded in a comment, they go unnoticed

Check.

> o  Embedded in a string, a warning is issued and the null ignored

I agree with Jason, in a string (or a character constant) they should
be passed through intact.

> o  Elsewhere, a warning is issued and the lexer skips it

Please have it look for and skip an entire block of nulls all at
once.  If the nulls came from filesystem corruption (more common than
you might think) there's likely to be, say, 512 of them in a row.

zw

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