From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,b1cd27db8b4f365c X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-03-22 07:39:12 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!newsserver.jvnc.net!yale.edu!yale!gumby!newsxfer.itd.umich.edu!sol.ctr.columbia.edu!howland.reston.ans.net!pipex!uknet!comlab.ox.ac.uk!earth!keith From: keith@earth.ox.ac.uk (Keith Refson) Subject: Re: Known problems with varargs on Alpha OSF/1 1.3? Message-ID: <1994Mar22.153912.2939@inca.comlab.ox.ac.uk> Organization: Dept of Earth Sciences, Oxford University, UK. X-Newsreader: TIN [version 1.2 PL2] References: <1978@applix.com> <2mk31b$ah4@news.iastate.edu> Date: Tue, 22 Mar 94 15:39:12 GMT Sean Murphy wrote: }Is anyone aware of any known problems with the varargs set of goodies }as implemented on the DEC Alpha system running OSF/1 1.3? Any problems }in the area of indexing thru the arg list with va_arg()? I have found a bug (well I'm sure I'm not the first). Variable-length argument lists containing "double" args don't work when the program is compiled with a) optimization and b) -std or -std1 ANSI modes. Here's a test case: The following program produces incorrect output Test vec = 2 3 3 ordinal when compiled with the options "-O" and "-std" and correct output Test vec = 1 2 3 ordinal otherwise. Keith Refson ---------------------- #include /****************************************************************************** * Format_vec Print the name and value of some parameter in same format * ******************************************************************************/ static void format_vec(text,value1,value2,value3,units) char *text; double value1,value2,value3; char *units; { (void)printf("\t%-32s = %g %g %g %s\n", text,value1,value2,value3,units); } main() { double one=1.0,two=2.0,three=3.0,four=4.0; format_vec("Test vec",one,two,three,"ordinal"); } -- ------------------------------------------------------------------------------ | Email : keith@earth.ox.ac.uk | Dr Keith Refson, Dept of Earth Sciences| | TEL(FAX): +44 865 272026 (272072) | Parks Road, Oxford OX1 3PR, UK | ------------------------------------------------------------------------------