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]

V3 PATCH: #undef abs (was Re: libstdc++ change breaks simple code)


Mixtim <mixtim@home.com> writes:

| Here is the code in question:
| 
| #include <cmath>
| 
| using namespace std;
| 
| int
| main()
| {
|    double d = sqrt(1.0);
|    return 0;
| }
| 
| gcc version 3.0 20010520 (prerelease) compiles this fine.
| 
| gcc version 3.0 20010525 (prerelease) barfs.


That is a latent bug.  Fixed with this.

-- Gaby

2001-05-26  Gabriel Dos Reis  <gdr@codesourcery.com>

	* include/c_std/bits/std_cmath.h (sqrt): #undef.

Index: include/c_std/bits/std_cmath.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cmath.h,v
retrieving revision 1.6.2.3
diff -p -r1.6.2.3 std_cmath.h
*** std_cmath.h	2001/05/25 21:40:45	1.6.2.3
--- std_cmath.h	2001/05/26 07:00:03
***************
*** 74,79 ****
--- 74,80 ----
  #undef pow
  #undef sin
  #undef sinh
+ #undef sqrt
  #undef tan
  #undef tanh
  


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