[EMAIL PROTECTED] writes:
>       - calling strMANYcat() is shorter (generated code wise) then
>         multiple calls to strcat()
>       - varargs is really cheap in the called function (and the cost
>         is all in a single location)
> 
> 
> 
> But the return value of strcat() is indeed useless.

Changing it would break:

        (void) strcpy(buffer, "more");
        (void) printf("both: %s\n", strcat(buffer, " and more"));

I don't see what the point is in debating whether the return values
are "useless."  They're fixed by standard and by compatibility
concerns.  Unless we're to produce a profusion of
str*_which_arg_would_you_like_returned() functions, we're up against
breaking existing code, and that would be very bad.

The storage qualifiers and perhaps even return types could be
something tweaked over time without disturbing existing objects,
though I doubt the latter for other reasons.  But I don't see how the
actual return value could.

As for strMANYcat, the operation seems sort of obvious and somewhat
useful, but I wonder how often in real, well-written code this
situation actually comes up _and_ snprintf isn't a better answer.

Might we be better off using our time to add %[rR] to printf/scanf for
Roman numerals?  :-/

-- 
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