https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106248
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- Comment 6 isn't right (it should be sgetc not snextc, and it needs to consider the stream's field width) but I'm testing a working patch now.