[EMAIL PROTECTED] writes:
> 
> >Just asked around, one of the very old staff here suggested that the
> >reason was that early CPUs only had only very few register so having the
> >"s1" in one of them as result of being the function's return value saved
> >some instructions. Weired (at least for todays standards).
> 
> While I thought of a reason similar to that, it's still strange;
> if you have so few registers, why keep one which points to the
> *first* byte?  The last byte written would make much more sense.

Indeed.  My understanding was that it was by analogy with assignment.
In other words, if you do this:

        a = b = c;

... then 'a' gets assigned to the value that was coerced into b.  In
other words, the "b = c" assignment has a value, and that value is the
same as 'b'.

The arguments in strcpy are ordered as if they're an assignment, and
they work that way:

        (void) strcpy(a, strcpy(b, c));

is analogous to the assignment above.

-- 
James Carlson, KISS Network                    <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to