VAX (VMS) C / strangeness (serious bug?) w/ prototypes and floats

Joseph Nathan Hall jnh at ece-csc.UUCP
Fri May 27 09:42:56 AEST 1988


The program

	void test(float x, float y, float z)
	{
		printf("%f %f %f", x, y, z);
	}

	main ()
	{
		float x, y, z;
		test(1.0, 2.0, 3.0);
		x = 1.0;
		y = 2.0;
		y = 3.0;
		test(x, y, z);
	}

produces the quixotic output

	1.000000 2.000000 1.000000
	3.000000 2.000000 3.000000

on my machine.  I'm running VAX C 2.3-024 on VAX/VMS 4.6, on a VAXstation II
GPX.  Versions of this where test is declared old-style and where x, y, and
z in the new-style declaration are double work fine.

Am I losing it, or is this as FUBAR as it seems?

-- 
v   v sssss|| joseph hall                      || 201-1D Hampton Lee Court
 v v s   s || jnh at ece-csc.ncsu.edu (Internet)  || Cary, NC  27511
  v   sss  || the opinions expressed herein are not necessarily those of my
-----------|| employer, north carolina state university . . . . . . . . . . . 



More information about the Comp.lang.c mailing list