http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45841
--- Comment #19 from David Krauss <potswa at mac dot com> 2010-10-05 02:58:04 UTC --- (In reply to comment #18) > Um... let me see if I got this right: the simulator with a buggy lseek caught > a > bug in your patch not seen in a correctly working environment? (That could > actually be issue #3.) Yep, accidentally seeking off the end causes read() to fail. Trying to read from the streambuf after a write causes a mode switch and virtual flush, which succeeds. I accidentally set the return error value variable to success based on flush success, causing getc() not to return EOF despite failure. The subsequent read did not have a flush and correctly returned EOF. Apparently reading after a write at EOF is not in the tests. > If so, I think that makes the top 5 weird bug behaviors in my experience! > (Ok, only some 22 years, nothing to speak of.) > > Don't forget that for the new patch, I think we need a separate new regression > test-case, one that "works" without relying on buggy simulators. :-D Yeah lol, I don't know if the regression case is really necessary, but I suppose I should work it in somewhere. Should I reference this bug in regards to such a change, or does that make more work for you? Do you mean 22 years of life or 22 years in the field ;v) … I think this is just serendipitous. Today is my 26th birthday, so you're either making me feel old or just experienced… I guess cutting my teeth on old Classic Mac OS and Apple Open Firmware (a fairly large Forth operating system, also deceased) gave me a fair share of weirdness, nothing has really surprised me for years… but I did quit software for a while in the meantime and this is my first return to operating systems…