On 23 June 2010 09:06, Marco Peereboom <[email protected]> wrote:
> On Wed, Jun 23, 2010 at 12:20:09AM +0200, Marc Espie wrote:
>> On Tue, Jun 22, 2010 at 06:53:12PM +0000, Miod Vallat wrote:
>> > > >> Is there any reson you use bcopy() not memcpy()?
>> > > >> If not considder using memcpy() please. :)
>> > >
>> > > > We couldn't care what you believe, unless you have diffs of your own
>> > > > to submit.
>> > >
>> > > I think the guy there asked if there is any difference, it was just
that. I
>> > > also don't know bcopy() and would like to know just out of curiosity
(I'm
>> > > really don't know, isn't not an irony): there's some difference
between
>> > > bcopy() and memcpy()?
>> >
>> > Yes, the order of the arguments. bcopy is intuitive: since you copy FROM
>> > somewhere TO somewhere, the arguments are FROM, TO, LENGTH. memcpy has
>> > FROM and TO exchanged, which is stupid. Some people argue this is
>> > because it is similar to an assignment, where you write DEST = SRC. But
>> > function calls are hardly assignments in my book.
>>
>> Err. shame on strcpy on being dest, src ?
>
> Totally.
>
>> Why don't you compaign to have miodstrlcpy( ) ?
>
> I'll switch tomorrow!
>
> miod is 100% right. memcpy is another committee hit job on
> practicality. OMG bcopy wasn't invented here lets flip around the
> parameters foar moar bettar!!!!one!!!```~!~!Y~%!^%
>
>
Not that anyone here cares, but I expect the original comment stems
from having read a linux manual for bcopy, which states:
CONFORMING TO
4.3BSD. This function is deprecated (marked as LEGACY
in
POSIX.1-2001): use memcpy(3) or memmove(3) in new programs. Note
that
the first two arguments are interchanged for memcpy(3) and
memmove(3).
POSIX.1-2008 removes the specification of bcopy().