Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!unmvax!ncar!asuvax!mcdphx!mcdchg!att!cuuxb!crom From: crom@cuuxb.ATT.COM (Netnews Administrator) Newsgroups: comp.lang.c++ Subject: STDARGS problem on sun4 Message-ID: <4150@cuuxb.ATT.COM> Date: 3 Sep 89 05:07:48 GMT Reply-To: att!spock!jcd (Jack Dixon) Organization: AT&T, Lisle, IL Lines: 53 I'm in the process of porting a C++ application from a sun3 to a sun4 and I've run into a problem with stdargs. I wrote the following little test program to show the problem. I'm using C++ 2.0. We're running Sun OS 4.0. #include void output( int, ... ); main() { output( 1, 2, 3, 0 ); } void output( int j, ... ) { va_list ap; va_start( ap, j ); int i; printf( "%d\n", j ); while ( ( i = va_arg( ap, int ) ) != 0 ) { printf( "%d\n", i ); } va_end( ap ); } On the sun3 the output is as expected: 1 2 3 However, on the sun4 we get: 1 32768 8192 The stdarg.h files for sun3 and sun4 are identical. Does anyone know the fix for this or can anyone at least confirm that this problem exists on their sun4s? Thanks much. -- -- Jack Dixon, AT&T { ...!att!dopsa!jcd, jcd@dopsa.att.com }