Joerg Schilling wrote:
Bill Holler <bill.hol...@sun.com> wrote:

Great discussion.

Linux and glibc have the same 64-bit implementation of strcpy(3C) & strncpy(3C) 
as Solaris.  The undefined behavior is the same as the current Solaris version.  
Those communities have accepted that code which calls str[n]cpy with overlapping 
strings is unsupported.  Solaris will do the same.

This looks like a joke....

Linux started to exist _after_ the interface for strcpy() was changed.
I am sure that the people who have been asked do not even know about the background and that before ~ 1988 there was no such limitation
in any documentation and the implementation was well known for supporting
overlapping strings.

In case it is not known, memmove() is not a replacement for strcpy() as it
takes a length parameter.

It seems like if you really have code that needs to use the specific implementation artifacts, you could just supply your own version. We're talking about one, or maybe two, depending on on style, lines of C, after all.

The point about Linux and glibc is that *many*, even *most* applications are not impacted. That you have a particular application that has a problem with this suggests that you ought to fix your application, regardless.

At this point the historical relevance is not interesting. What is interesting is what the *standards* that we conform to today say, and what the existing code base is. (And that's where the Linux example is pertinent -- their set of software applications is vast enough to act as a significant counterexample to the argument that "many applications will break". So far its just one. Yours. Fix it. :-)

   - Garrett


_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to