This is the mail archive of the libstdc++-prs@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: libstdc++/61: Conflicting types for nan() during installation


The following reply was made to PR libstdc++/61; it has been noted by GNATS.

From: Benjamin Kosnik <bkoz@cygnus.com>
To: dmeranda@medplus.com
Cc: libstdc++-gnats@sourceware.cygnus.com
Subject: Re: libstdc++/61: Conflicting types for nan() during installation
Date: Thu, 18 May 2000 10:07:51 -0700 (PDT)

 i just did work on CVS libstdc++ specifically for HPUX11.
 
 2000-05-10  Benjamin Kosnik  <bkoz@redhat.com>
 
         * bits/std_cmath.h: Tweaks.
         * math/mathconf.h: Tweaks and fixes for HP-UX 11.
         (sqrtf): Define away iff !builtin and !in <math.h>. 
         (sinf): Same.
         (cosf): Same.
         (fabsf): Same.
         At some point this directory should be converted to c++, the
         autoconf tests should be run by the c++ compiler (not c), and
         <cmath> should be used instead of math.h.
         Move declaration of nan() here.
         * math/complex-stub.h (cabsl): Remove nan() declaration.
 
  
 You'll need to use CVS libstdc++. 
 
 FYI HPUX11 support is still "not there" due to problems with weak linking 
 and the native ld. I'll post to the list when I've got things working.
 
 -benjamin
 
 On 18 May 2000 dmeranda@medplus.com wrote:
 
 > 
 > >Number:         61
 > >Category:       libstdc++
 > >Synopsis:       Conflicting types for nan() during installation
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       high
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Thu May 18 08:37:00 PDT 2000
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Deron Meranda
 > >Release:        2.90.8
 > >Organization:
 > >Environment:
 > HP-UX 11.0, gcc 2.95.2
 > >Description:
 > Trying to build/install libstdc++ fails under HP-UX 11.0.
 > During the compile of the file libstdc++/math/signbit.c,
 > the following error is output:
 > 
 > In file included from /opt2/src/gcc-2.95.2/libstdc++/math/mathconf.h:230,
 >                  from /opt2/src/gcc-2.95.2/libstdc++/math/signbit.c:32:
 > /opt2/src/gcc-2.95.2/libstdc++/math/complex-stub.h:85: conflicting types for `nan'
 > /opt2/src/gcc-build2/gcc/include/math.h:231: previous declaration of `nan'
 > 
 > The HP-UX 11.0 operating system declares the following
 > prototype for function nan() in /usr/include/math.h,
 > 
 >    extern double nan(const char*)
 > 
 > whereas libstdc++ 2.90.8 declares it as
 > 
 >    double nan(void)
 > >How-To-Repeat:
 > Install gcc 2.95.2 with libstdc++ 2.90.8 placed in the
 > libstdc++ subdirectory.  Using the HP-UX bundled cc
 > compiler.  Configured with options,
 > 
 > configure --prefix=/opt/gnu/gcc --with-gnu-as
 > --with-as=/opt/gnu/bin/gas --enable-haifa
 > --enable-threads=posix --enable-namespaces
 > --enable-languages=c,c++,java
 > hppa1.0-hp-hpux11.00
 > >Fix:
 > Changing the following files seems to appease the
 > compiler, but I'm not sure what the real solution
 > should be or what matches the language standard...
 > 
 > libstdc++-2.90.8/math/complex-stub.h
 > libstdc++-2.90.8/math/mathconf.h
 > libstdc++-2.90.8/math/nan.c
 > 
 > I modified the nan() function to take a const char*
 > argument to make it match the HP-UX declaration.
 > The macro NAN was defined to be (nan("")).  And the
 > nan() function was rewritten as,
 > 
 > double
 > nan (const char *n)
 > {
 >    if (n==NULL || ! n[0])
 >       return strtod ("nan", NULL);
 >    else
 >       return strtod (n, NULL);
 > }
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 > 

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