This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for PR 15235 libgfortran doesn't build on Solaris


Rainer Orth wrote:
Don't believe glibc docs, but check the actual standards/system
documentation :-)
That's what I did :-) 'man isinf' on a sun box.

Won't help either: <sunmath.h> and libsunmath aren't part of the core O/S, but are distributed with Sun's compilers (WorkShop, Forté, Sun Studio, whatever it is called today), so this will only help if you have bought that compiler. Besides, the library and header are installed somewhere

ok, didn't know that.


all.  libstdc++-v3/config/locale/generic/c_locale.cc suggests that finite()
may be more widespread than isinf() (and in fact, it exists on Solaris
8/10, Tru64 UNIX V4.0F/V5.1B, and IRIX 5.3/6.5).



Could you try the attached patch then? Built and tested with no regressions.


- Tobi

2004-05-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>

* io/write.c (write_float): Check for finite(), adapt tests.


Index: write.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/write.c,v
retrieving revision 1.4
diff -u -p -r1.4 write.c
--- write.c	16 May 2004 14:07:58 -0000	1.4
+++ write.c	17 May 2004 18:22:56 -0000
@@ -520,10 +520,10 @@ write_float (fnode *f, const char *sourc
          p = write_block (nb);
          memset (p, ' ' , 1);
          
-         res = isinf (n);
-         if (res != 0)
+         res = finite (n);
+         if (res == 0)
          {
-            if (res > 0)
+            if (n > 0)
                fin = '+';
             else
                fin = '-';


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]