Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!sdcsvax!ucsdhub!esosun!seismo!uunet!mcvax!enea!tut!santra!hsu From: hsu@santra.UUCP (Heikki Suonsivu) Newsgroups: comp.sys.ibm.pc Subject: Re: bug in Turbo C 1.5 Keywords: turbo C memcpy memory Message-ID: <10002@santra.UUCP> Date: 28 Jan 88 01:39:26 GMT References: <5298@cit-vax.Caltech.Edu> Reply-To: hsu@santra.UUCP (Heikki Suonsivu) Organization: Helsinki University of Technology, Finland Lines: 20 In article <5298@cit-vax.Caltech.Edu> tim@cit-vax.UUCP (Timothy L. Kay) writes: >The Turbo C 1.0 memcpy() detects if the source and destination >overlap and switches the direction of the copying. Borland must have >decided that the memcpy() routine should not be so smart. The Turbo 'man memcpy' and other C manuals I have around, state "Because character movement is performed differently in different implementations, overlapping moves (memcpies) may yield unexpected results". Using such a feature, even if it exists in some certain compiler/library, will certainly make code unportable. Haven't read Turbo C manuals so I have no idea whether there is something about this, but I hope there is, otherwise there will be lots of nice code which can be used in all machines which run turbo-C, but rest of the world will have lots of fun porting it, specially when bugs generated by that kind of thing are sometimes quite hard to find. Inet: hsu@santra ................. Kuutamokatu 5 A 7 Uucp: ...!mcvax!santra!hsu ....... 02210 Espoo ..... Fido: Heikki Suonsivu at 2:504/1 . FINLAND .........