This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

- Ben


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]