chang@osc.COM (Lai-Chang Woo) (03/07/91)
I posted the following to comp.unix.ultrix, but received no reply, so I'm trying this group: My problem is that I need the ANSI-style definitions in <stdarg.h> for C++ functions, but Ultrix 4.0 cc only works with <varargs.h>. Needless to say, the two files are nothing like each other. I thought of producing some sort of hybrid, but some experimentation led to the discovery that when the all-powerful va_alist is not included in the argument list of the called routine, the variable arguments from the calling routine are not even pushed onto the stack! To illustrate: ----- void func ( argA, argB /* , va_alist */ ) char *argA; char *argB; /* int va_alist; */ { . . . } main () { . . func ( "hello", "world", "variable", "part" ); . . } ----- when run under dbx, does not show up "variable" or "part", or any pointer to them, anywhere on the stack. But I can't include va_alist in the C++ function declaration, and my C++ translator (AT&T version 2.0, btw) doesn't insert it for me either. Short of fixing the translator, how can I get around this? Has anyone successfully produced a hybrid header file that works under the circumstances? Currently I fix the C output of the translator by hand, but that is painful to say the least, so any help would be most appreciated. Please email replies to chang%osc.osc.com@uunet.uu.net. I'll post a summary if anyone requests it. Thanks in advance. Lai-Chang Woo Versant Object Technology
hueni@optolab.pyl.unibe.ch (hermann hueni) (03/08/91)
In article <4660@osc.COM> chang@osc.UUCP (Lai-Chang Woo) writes: > > >My problem is that I need the ANSI-style definitions in <stdarg.h> for C++ >functions, but Ultrix 4.0 cc only works with <varargs.h>. I use g++ 1.39 with libg++ 1.39 on Ultrix 4.1 and as far as I can tell, the library component that implements interfaces to the curses library uses <stdarg.h> successfully in: CursesW.cc, CursesWindow::scanw( const char * fmt, ...) you might want to look at that. regards, hermann hueni hueni@iam.unibe.ch