[PATCH] GCC bootstrap failure on cygwin is gawk 3.1.2 bug!

Neil Booth neil@daikokuya.co.uk
Tue Jun 17 07:48:00 GMT 2003


Roger Sayle wrote:-

> The bug itself is in the function rsnull_get_a_record of io.c when the
> end of a record is reached when searching for a blank line, i.e. it only
> triggers in RS="" mode.  The problem is that after the remaining
> unread data is shuffled to the beginning of the buffer, the "bp"
> pointer is set to end of the unread data, rather than reset to the
> beginning.
> 
> This fouls up the code later on, on line 2826 of 3.1.2's io.c that
> assumes that "bp" points to the very beginning of the record, that
> skips blank lines before the record starts.  Hence, in the rare
> occurrence that the character immediately following the remaining
> "unread" partial record, i.e. the first character returned by "read"
> is a newline, we completely skip/loose this partial line/record.

Uh, I'll take your word for it 8-)  Thanks for looking at this.

> My apologies to the gawk folks if they were already aware of this,
> and have a bug fix awaiting their next major release.  The cygwin
> folks might consider patching their version of gawk.  But I
> suspect the best way out of this mess is for GCC to change the
> format of lang.opt files, so that the command line options name
> and attributes all appear on a single line.  The first field
> being the flag name, the remaining fields being the attributes.
> This would avoid requiring RS="" mode, and allow the first gawk
> step to be skipped entirely, immediately proceeding to the sort.

Hmm; I'd like to keep the multiline format because there is other
information to come later, like --help text.

Would using RS="^L" work like so?  Or does the \n after the ^L get
in the way?

Wdeprecated
C++ ObjC++

Wdiv-by-zero
C ObjC


Otherwise I'm going to have to resort to writing something in C
I guess.

Neil.



More information about the Gcc-patches mailing list