site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com hi- thanks!- You're looking in the wrong direction by looking for GNU functions. -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Sep 9, 2009, at 5:20 AM, lbland <lbland@vvi.com> wrote: On 32-bit, I can build a va_list by hand (using simple pointer arithmetic) and call functions that accept va_list. But, on 64-bit the va_list changed and the way I build va_list on 32- bit does not work. Are there some functions that I can uses to push variables onto the va_list (stack)? - maybe even cross-platform GNU functions? ... ANSI-C defines how to pop them off, but I can't find a good way to push them on. -lance About the only use for this would be in-flight hacking of the arguments to a varradic function before passing them off to another, second varradic function, either insertion or deletion. Otherwise you would just make the call to the second function. For almost all printf- like functions you can simple make multiple calls to the underlying function, since they are appending data to an unflushed memory buffer in any case, so there should be no real performance impact since things are being write gathered into the I/O buffer anyway. It's possible to do, but it would be handier to see how you're currently doing it so we could tell you what you were doing wrong. Typically it tends to be a mistake in alignment on the basis of incorrect assumptions about alignment boundaries and packing for a given ABI, typically dealing with type promotion to wider types. It's also why the POSIX standard states that what you want to do is undefined, and why most people go to great lengths to avoid doing it, and why it typically can not be done portably. See also section 15.13 of the C language FAQ. This email sent to site_archiver@lists.apple.com