This patch fixes a few minor other warnings that occur in libc++'s
headers, when building with -Wsystem-headers.
In include/cmath:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:246:
/usr/include/c++/v1/cmath:1204:9: warning: 'FP_FAST_FMAF' macro redefined
#define FP_FAST_FMAF
^
/usr/include/math.h:71:9: note: previous definition is here
#define FP_FAST_FMAF 1
^
On FreeBSD, this symbol is already defined in the system headers, so to
fix the warning, add guards.
In include/ccomplex:
In file included from /usr/include/c++/v1/ccomplex:21:
/usr/include/c++/v1/complex:1253:13: warning: add explicit braces to avoid
dangling else [-Wdangling-else]
else
^
This can be fixed by adding a pair of braces in the right place.
In incldue/ext/hash_map:
In file included from /usr/include/c++/v1/ext/hash_map:206:
/usr/include/c++/v1/ext/__hash:45:8: warning: extra tokens at end of #endif
directive [-Wextra-tokens]
#endif _LIBCPP_EXT_HASH
^
This is just a typo, which can be fixed by adding //.
-Dimitry
This patch fixes a few minor other warnings that occur in libc++'s
headers, when building with -Wsystem-headers.
In include/cmath:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:246:
/usr/include/c++/v1/cmath:1204:9: warning: 'FP_FAST_FMAF' macro redefined
#define FP_FAST_FMAF
^
/usr/include/math.h:71:9: note: previous definition is here
#define FP_FAST_FMAF 1
^
On FreeBSD, this symbol is already defined in the system headers, so to
fix the warning, add guards.
In include/ccomplex:
In file included from /usr/include/c++/v1/ccomplex:21:
/usr/include/c++/v1/complex:1253:13: warning: add explicit braces to avoid dangling else [-Wdangling-else]
else
^
This can be fixed by adding a pair of braces in the right place.
In incldue/ext/hash_map:
In file included from /usr/include/c++/v1/ext/hash_map:206:
/usr/include/c++/v1/ext/__hash:45:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
#endif _LIBCPP_EXT_HASH
^
This is just a typo, which can be fixed by adding //.
Index: include/cmath
===================================================================
--- include/cmath (revision 166410)
+++ include/cmath (working copy)
@@ -1202,7 +1202,9 @@ fdim(_A1 __x, _A2 __y) _NOEXCEPT
// fma
inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);}
+#ifndef FP_FAST_FMAF
#define FP_FAST_FMAF
+#endif
using ::fma;
Index: include/complex
===================================================================
--- include/complex (revision 166410)
+++ include/complex (working copy)
@@ -1249,10 +1249,12 @@ acosh(const complex<_Tp>& __x)
if (isnan(__x.imag()))
return complex<_Tp>(abs(__x.real()), __x.imag());
if (isinf(__x.imag()))
+ {
if (__x.real() > 0)
return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
else
return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
+ }
if (__x.real() < 0)
return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
Index: include/ext/__hash
===================================================================
--- include/ext/__hash (revision 166410)
+++ include/ext/__hash (working copy)
@@ -43,4 +43,4 @@ template <> struct _LIBCPP_VISIBLE hash<char *>
};
}
-#endif _LIBCPP_EXT_HASH
+#endif // _LIBCPP_EXT_HASH
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits