Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* may be a little CXX bug on ALPHA in stdarg with float.
@ 1995-09-27  4:00 Jean-Louis Moser
  0 siblings, 0 replies; only message in thread
From: Jean-Louis Moser @ 1995-09-27  4:00 UTC (permalink / raw)



| May be here is a bug in DEC C++ V5.0-3 for DEC OSF/1 (Alpha).

#include <iostream.h>
#include <stdarg.h>

void foo (float a, ...)
{
    va_list list;
    va_start (list, a);
    while (a != 0) {
	cout << a << " ";
	a = va_arg (list, float);
    }
    cout << endl; va_end (list);
}

void main ()
{
    foo (1.0f,2.0f,3.0f,4.0f,0);
}

the result is : 1 (it may be: 1 2 3 4)

when we replace float with short, int, double, or struct A {long x_; long y_;};
it work fine. There is the same problem with cc and GNU g++.

--
+----------------------------+------------------------------------+
|   Jean-Louis Moser         |    2001 SA                         |
|   tel: 33 (1)46.66.54.54   |    2, rue de la renaissance        |
|   Email: jlm@two-oo-one.fr |    F-92184 Antony Cedex            |
+----------------------------+------------------------------------+



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-09-27  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-27  4:00 may be a little CXX bug on ALPHA in stdarg with float Jean-Louis Moser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox