Mail Archives: djgpp-workers/2003/01/11/07:38:19.1
Hello.
Eli Zaretskii wrote:
[snip]
> I don't like citing undefined behavior in documentation that covers
> specific implementations. A specific implementation has specific,
> defined behavior, and IMHO we should tell the programmer what that is.
OK. But some people may be learning C programming from the DJGPP libc docs. So
I think the page should at least describe the behaviour as specified and then
note any implementation-specific differences. Otherwise developers may expect
their code to work exactly the same way on other platforms.
> > That's a good idea. But might not say much ("if they do, your code
> > might do anything; at least one of the effects being writing over
> > memory way out of bounds").
>
> Is this really what will happen? I always thought strcpy and friends
> handled overlapping buffers correctly. If that's not true, similar
> remarks should be added to the docs of strcpy and strcat.
Their behaviour is undefined with overlaps according to C99.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -