This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Creating a va_list dynamically?


> 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.

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