Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!tandem!netcom!rcb From: rcb@netcom.COM (Roy Bixler) Newsgroups: comp.sys.atari.st.tech Subject: Re: bug in GNU library Keywords: stat() bug Message-ID: <1991Mar28.194823.2209@netcom.COM> Date: 28 Mar 91 19:48:23 GMT References: <1991Mar27.152726.8444@doe.utoronto.ca> Organization: Netcom - Online Communication Services UNIX System {408 241-9760 guest} Lines: 44 In article <1991Mar27.152726.8444@doe.utoronto.ca> david@doe.utoronto.ca (David Megginson) writes: > >In <1991Mar27.030421.587@netcom.COM>, Roy Bixler writes: >> >> I've found a bug (or at least an unintuitive feature :-) ) in the >> library supplied with GNU C 1.37.1 found on atari.archive. When I >> make a call to stat(), after the call, the address returned by >> Fgetdta() is different than it was before the call. Is this a bug? >> If so, why would it be desirable for stat() to have this side-effect? >> >> -- >> Roy Bixler >> rcb@netcom.com -or- (UUCP) uunet!apple!netcom!rcb > >That's precisely why you have to call Fgetdta(). Usually, you would not >want to mix Unix-type calls (stat()) and TOS-type calls (Fsfirst()/Fsnext()) >in the same program anyway, but if you have to, always check. I would argue that the stat() and all other such functions should have an Fgetdta() in the 1st line of their code and an Fsetdta() in the last. That is just good practice. Probably a moot point, since GCC library is free and you get what you pay for. [reasons for stat() et al's unfriendly behavior deleted] >In general, you might want to switch to Eric Smith's MiNT library. It >is an update and improvement on the standard GCC library, and is >also available on atari.archive. Yes, but you need MiNT to run a program compiled with that library, correct? If not, that is definitely a win-win situation! > > >-- >//////////////////////////////////////////////////////////////////////// >/ David Megginson david@doe.utoronto.ca / >/ Centre for Medieval Studies meggin@vm.epas.utoronto.ca / >//////////////////////////////////////////////////////////////////////// -- Roy Bixler rcb@netcom.com -or- (UUCP) uunet!apple!netcom!rcb