[13952] in Athena Bugs

home help back first fref pref prev next nref lref last post

Re: sun4 7.7T: suncc missing a define ...

daemon@ATHENA.MIT.EDU (Derek Atkins)
Wed Oct 25 16:39:22 1995

Date: Wed, 25 Oct 1995 16:39:07 -0400
From: Derek Atkins <warlord@MIT.EDU>
To: cfields@MIT.EDU
Cc: jawetzel@MIT.EDU, bugs@MIT.EDU
In-Reply-To: "[13950] in Athena Bugs"

FYI: You probably want to call suncc with -Xa (instead of -Xc).  This
way you get ANSI without being strict ANSI.  MAXDOUBLE is not ANSI C.
According to ANSI C section 2.2.4.2.2 (ISO spec section 5.2.4.2.2):

"characteristics of floating types are defined in terms of a model
that describes a representation of floating-point numbers ..."

It goes on to say that floating point defintions should be in
<float.h>, and that the "maximum representable finite floating-point
number" is:

FLT_MAX, DBL_MAX, and LDBL_MAX

So, to be strictly ANSI-C compliant, you should #include <float.h> and
use DBL_MAX, rather than #include <values.h> and use MAXDOUBLE.

Enjoy!

-derek

home help back first fref pref prev next nref lref last post