This is the mail archive of the
mailing list for the GCC project.
Creating a va_list dynamically?
- To: gcc at gcc dot gnu dot org
- Subject: Creating a va_list dynamically?
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 9 Oct 2000 13:22:14 -0400 (EDT)
Is it possible to dynamically and portably create a va_list?
I'm trying to see if I can easily teach gcc to optimize e.g.
> fprintf("%d %s", 5, "hello") -> fputs("5 hello")
What I'd like to do is, at compile time, take the tree structures
representing 5 and "hello" and dynamically create a va_list out of
them. Then I'd pass the format arg and the va_list to vasprintf() and
emit a call to fputs with the resulting string.
(If I can't use something like vasprintf, I'd have to rewrite a
complete *printf parser. Bleah.)
Any info would be appreciated.
Kaveh R. Ghazi Engagement Manager / Project Services
email@example.com Qwest Internet Solutions