This is the mail archive of the
mailing list for the glibc project.
Re: [libc-alpha] Re: [open-source] Re: Wish for 2002 ...
- From: <mouring at etoh dot eviladmin dot org>
- To: Kaz Kylheku <kaz at ashi dot footprints dot net>
- Cc: Sandy Harris <sandy at storm dot ca>, "Martin v. Loewis" <martin at v dot loewis dot de>, <aoliva at redhat dot com>, <netch at iv dot nn dot kiev dot ua>, <torvalds at transmeta dot com>, <markus at openbsd dot org>, <eggert at twinsun dot com>, <leclerc at austin dot sns dot slb dot com>, <security-audit at ferret dot lmh dot ox dot ac dot uk>, <libc-alpha at sources dot redhat dot com>, <openssh at openbsd dot org>
- Date: Sat, 12 Jan 2002 22:05:27 -0600 (CST)
- Subject: Re: [libc-alpha] Re: [open-source] Re: Wish for 2002 ...
On Sat, 12 Jan 2002, Kaz Kylheku wrote:
> 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.
Very good reason not do. You no longer know what code your generating.
That is the whole issue that GCC has. Do you really want GCC to *GUESS*
that your intent? I sure don't.
You no longer know if for some odd reason the compiler misguesse an
optmization (with happens too offen for my taste) and the resulting code
could be flawed enough to be insecure (be it data security, system
security, whatever). Hell, Linus can attest to how bad GCC is between
releases in it's 'quarks'.
It is a real shame we left the days where predictability of compiler
output and simple optimizations rules. We were all much better off losing
that 2% speed for known output.