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]

Creating a va_list dynamically?


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.

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

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