This is the mail archive of the 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]

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

>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
>Originator:     Deron Meranda
>Release:        2.90.8
HP-UX 11.0, gcc 2.95.2
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)
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
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...


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,

nan (const char *n)
   if (n==NULL || ! n[0])
      return strtod ("nan", NULL);
      return strtod (n, NULL);

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