[Top] [All Lists]

Re: Float / Double issues

To: Tim Hockin <>
Subject: Re: Float / Double issues
From: Ralf Baechle <>
Date: Wed, 14 Jul 1999 22:52:22 +0200
In-reply-to: <>; from Tim Hockin on Mon, Jul 12, 1999 at 08:09:41PM -0700
References: <>
On Mon, Jul 12, 1999 at 08:09:41PM -0700, Tim Hockin wrote:

> 2) Floats and va_arg crash with an FPE
> below are two snippets that show these, at least on our boxes.  If
> someone could confirm or deny their existence on any other platform?

The float / va_arg bug is a pilot error.  See ANSI C draft chapter,
paragraph 6 and7.  In short the problem is that float parameters will be
promoted to double.  You therefore have to to change the call of va_arg
in your float.c to va_arg(va, float).

Obvious, heh ;-)

Btw, SGI's compiler also doesn't attempt to get va_arg(..., float) right.


<Prev in Thread] Current Thread [Next in Thread>