casper....@sun.com wrote: >> Most existing programs have been written before the standard was changed >> and I know of a lot of places where strcpy() is called with overlapping >> buffers >> in order to e.g. deal with escaped strings. > > I understand what you mean. Clearly the standard says that this is > undefined but the practice that it works when copying overlapped strings > in such a way that a naive implementation would get it right. > > > I've not seen the issue and a short example would be nice to see.
An example seems crucial, along with details -- such as the compiler in use and the compilation options. I tried it with a few different Sun Studio compilers running AMD64 binaries on snv_129, and all of the overlapping copy attempts that I made with strcpy() worked just fine. Not enough to say "no such bug," but it doesn't seem easy to reproduce. Perhaps it's an issue just with a particular buffer alignment or compiler. Some of them are known to use surprising kinds of optimization when handling certain 'known' libc functions. -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code