autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_C_LONG_DOUBLE is wrong on IRIX 5.3


From: Oliver Kiddle
Subject: AC_C_LONG_DOUBLE is wrong on IRIX 5.3
Date: Wed, 07 Nov 2001 14:03:23 +0000

AC_C_LONG_DOUBLE is providing the wrong answer (yes instead of no) on
IRIX 5.3.

The test for long double is compiling roughly this:

int main () {
  long double foo = 0.0;
  /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
  exit (sizeof (long double) < sizeof (double));
}

Compiling gives:
Indy:/tmp [231]% cc ./longdub.c 
cfe: Warning 728: ./longdub.c, line 4: Long double not supported; double 
assumed.
   long double foo = 0.0;
 --^
So this produces an executable and because it has assumed double, the
sizes are equal so the executable returns 0 (success).

The solution is to change the exit status to this:
        sizeof (long double) <= sizeof (double)

In case it is easier than manual editing, I've attached a patch against
autoconf 2.52f sources. Presumably autoconf.m4f is autogenerated?

Oliver Kiddle

PS. I don't subscribe so please copy me in any reply.

--- lib/autoconf/c.m4.old       Wed Nov  7 13:57:29 2001
+++ lib/autoconf/c.m4   Wed Nov  7 13:57:31 2001
@@ -840,7 +840,7 @@
      support it.  */
   long double foo = 0.0;
   /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-  exit (sizeof (long double) < sizeof (double));
+  exit (sizeof (long double) <= sizeof (double));
 }],
 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
 fi])

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]