Creating a va_list dynamically?
Mike Stump
mrs@windriver.com
Mon Oct 9 11:50:00 GMT 2000
> Date: Mon, 9 Oct 2000 13:22:14 -0400 (EDT)
> From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
> To: gcc@gcc.gnu.org
> I'm trying to see if I can easily teach gcc to optimize e.g.
> > fprintf("%d %s", 5, "hello") -> fputs("5 hello")
> (If I can't use something like vasprintf, I'd have to rewrite a
> complete *printf parser. Bleah.)
I almost think we are better off with a complete parser. The reason
is that target system and host system are inherently !=, and a system
can have local extentions that don't match anything. You want a
conservative approach to % semantics, with non-portable % being
deferred til runtime. Also, if you handle %s %d %c and the various
forms of them and the other numeric formats, you will have 99% of of
all format strings.
Also, be sure to disable optimizations that bloat code when -Os is
given.
More information about the Gcc
mailing list