This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Patch to remove unused `NAN' and `nan' from libstdc++-v3


As discussed in this thread:
http://gcc.gnu.org/ml/gcc/2002-11/msg01096.html

The patch below removes the unused `NAN' and `nan' symbols from
libstdc++-v3.  Bootstrapped and regtested on sparc-sun-solaris2.7, no
regressions.  The warnings which prompted the thread are (naturally)
gone.

Ok to install?

		Thanks,
		--Kaveh


2002-11-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* libmath/mathconf.h (NAN, nan): Delete.
	* acinclude.m4 (nan): Don't check for it.
	* config/linker-map.gnu (nan): Delete.
	* libmath/nan.c: Delete.

	* aclocal.m4, config.h.in, configure: Update.

diff -N -rup orig/egcc-CVS20021127/libstdc++-v3/libmath/mathconf.h egcc-CVS20021127/libstdc++-v3/libmath/mathconf.h
--- orig/egcc-CVS20021127/libstdc++-v3/libmath/mathconf.h	2001-08-16 16:30:38.000000000 -0400
+++ egcc-CVS20021127/libstdc++-v3/libmath/mathconf.h	2002-11-28 13:09:26.195704931 -0500
@@ -79,11 +79,6 @@ typedef int Int64_t __attribute ((mode (
 # include <nan.h>
 #endif
 
-#ifndef NAN
-# define NAN (nan())
-double nan (void);
-#endif
-
 #ifdef HAVE_IEEEFP_H
 # include <ieeefp.h>
 #endif
diff -N -rup orig/egcc-CVS20021127/libstdc++-v3/acinclude.m4 egcc-CVS20021127/libstdc++-v3/acinclude.m4
--- orig/egcc-CVS20021127/libstdc++-v3/acinclude.m4	2002-11-21 07:00:48.000000000 -0500
+++ egcc-CVS20021127/libstdc++-v3/acinclude.m4	2002-11-28 13:02:01.169138151 -0500
@@ -897,7 +897,7 @@ dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
   dnl Check for complex versions of math functions of platform.
   AC_CHECK_LIB(m, main)
-  AC_REPLACE_MATHFUNCS(nan copysignf)
+  AC_REPLACE_MATHFUNCS(copysignf)
 
   dnl For __signbit to signbit conversions.
   AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
diff -N -rup orig/egcc-CVS20021127/libstdc++-v3/config/linker-map.gnu egcc-CVS20021127/libstdc++-v3/config/linker-map.gnu
--- orig/egcc-CVS20021127/libstdc++-v3/config/linker-map.gnu	2002-11-26 07:01:22.000000000 -0500
+++ egcc-CVS20021127/libstdc++-v3/config/linker-map.gnu	2002-11-28 13:10:04.782064464 -0500
@@ -235,7 +235,6 @@ GLIBCPP_3.2.1 {
   sqrtf;
   sqrtl;
   copysignf;
-  nan;
   __signbit;
   __signbitf;
   __signbitl;
diff -N -rup orig/egcc-CVS20021127/libstdc++-v3/libmath/nan.c egcc-CVS20021127/libstdc++-v3/libmath/nan.c
--- orig/egcc-CVS20021127/libstdc++-v3/libmath/nan.c	2002-01-16 16:31:19.000000000 -0500
+++ egcc-CVS20021127/libstdc++-v3/libmath/nan.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,36 +0,0 @@
-/* Return quiet nan. */
-
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
-
-   This file is part of the GNU ISO C++ Library.  This library is free
-   software; you can redistribute it and/or modify it under the
-   terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License along
-   with this library; see the file COPYING.  If not, write to the Free
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.
-
-   As a special exception, you may use this file as part of a free software
-   library without restriction.  Specifically, if other files instantiate
-   templates or use macros or inline functions from this file, or you compile
-   this file and link it with other files to produce an executable, this
-   file does not by itself cause the resulting executable to be covered by
-   the GNU General Public License.  This exception does not however
-   invalidate any other reasons why the executable file might be covered by
-   the GNU General Public License.  */
-
-
-#include <stdlib.h>
-#include <string.h>
-
-double
-nan ()
-{ return strtod ("nan", NULL); }


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