This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

Re: [PATCH] math.h and fixincludes


Thanks Vladimir. I couldn't believe that fixincludes had such an ugly hack in it until I just read through the code. Patch checked in.

-- Jeff J.

Vladimir Prus wrote:
Hello,
at the moment, gcc's fixincludes tool tries to fix math.h because it sees that 'exception' name is used and thinks that it's not C++-safe. In fact,
newlib's math.h has appropriate __cplusplus checks, but fixincludes is not smart enough to recognize that.


This patch fixes the situation by adding a comment to math.h that is specially recognized by fixincludes. OK?

- Volodya

2006-10-25 Vladimir Prus <vladimir@codesourcery.com>

	* libc/include/math.h: (exception): Add a comment
	telling fixincludes that we handle C vs. C++ issue.



------------------------------------------------------------------------

Index: math.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/math.h,v
retrieving revision 1.21
diff -u -p -r1.21 math.h
--- math.h 27 Feb 2006 23:51:28 -0000 1.21
+++ math.h 25 Oct 2006 18:13:12 -0000
@@ -336,7 +336,8 @@ extern int *__signgam _PARAMS((void));
#define __signgam_r(ptr) _REENT_SIGNGAM(ptr)
/* The exception structure passed to the matherr routine. */
-
+/* We have a problem when using C++ since `exception' is a reserved
+ name in C++. */
#ifdef __cplusplus
struct __exception #else


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