This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: patch to suggest putc/fputs over printf("string") or printf("\n")
- To: law at cygnus dot com
- Subject: Re: patch to suggest putc/fputs over printf("string") or printf("\n")
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Sat, 16 Jan 1999 22:42:56 +0000
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, egcs-patches at cygnus dot com, egcs at cygnus dot com
- References: <19990116111324.C1011@tantalophile.demon.co.uk> <7663.916522184@hurl.cygnus.com>
> > It would be nice to avoid pulling in the floating point conversions when
> > possible :-)
> Absolutely. That's why it originally came up internally at Cygnus. We get a
> fair number of questions/complaints in this area. Some programmer does
> fprintf (stream "error: %s", someerror);
>
> Then they start asking why they sucked in the fp emulation code since they
> know their code doesn't do any floating point operations.
This seems eminantly fixable.
If any printf format includes a floating point specifier, or a
non-constant format, include a reference to a symbol which will pull in
and register the floating point conversions. Otherwise don't.
-- Jamie