[libc-alpha] Re: [open-source] Re: Wish for 2002 ...
Kaz Kylheku
kaz@ashi.footprints.net
Sat Jan 12 19:13:00 GMT 2002
On Sat, 12 Jan 2002, Sandy Harris wrote:
> "Martin v. Loewis" wrote:
>
> > Notice that -liberty offers this as concat(const char* first, ...).
>
> That strikes me as a function worth having, though perhaps not in standard
> libraries.
I'd rather have the compiler analyze *printf format strings and
generate code. There is no reason why
snprintf(d, sizeof d, "%s%s", s1, s2)
can't be compiled into calls to some compiler run-time support
function that catenates directly.
The GNU compiler can already analyze the format string for the purpose
of error checking; the next obvious step is code generation.
In priciple, a compiled sprintf can do anything which a variable-argument
concat can do, just as efficiently.
More information about the Libc-alpha
mailing list