Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcc6!sdcc7!muller From: muller@sdcc7.ucsd.EDU (Keith Muller) Newsgroups: comp.lang.c++ Subject: stdarg.h on sun4 (sparc) Keywords: stdarg.h sparc Message-ID: <1244@sdcc7.ucsd.EDU> Date: 30 Mar 89 05:20:31 GMT Organization: University of California, San Diego Lines: 20 Thought I might pass this on in case someone else runs into this... (Of course if this topic has been covered before I apologize). I just ran into a problem with C++ on a sparc (sun4) machine using the ATT C++. It turns out that stdarg.h will not work on the sparc machine. To get variable length args to work, the last arguement in a function has to have the name __builtin_va_alist. Any other name (or the lack of a name in stdarg.h's case) will not generate the proper code to pass the variable number of args (due to the way sparc handles function parameters). In my case I got around this by post-processing the c code emitted by C++ to use the varargs.h equivalent mechanisms (I didn't want to modify the C++ source to work around this). Clearly this is not a clean solution, but it got me out of a short term bind. (Of course __builtin_va_alist is not that palatable either).... Keith Muller University of California, San Diego