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

Re: fixinc regression for <math.h> with C++ on Solaris 9


Gerald Pfeifer wrote:
On Mon, 19 Jan 2004, Bruce Korb wrote:

I don't have CVS access here.  It might be interesting to do a ``cvs log''
on gcc/fixinc/tests/base/math.h and see what happened to the same code.


It seems the code is still there. The only relevant changes I found were
the following, which seems harmless,

  date: 2003/01/04 21:14:54;  author: korbb;  state: Exp;  lines: +6 -6
  branches:  1.11.4;
  When wrapping files, guard with both the fix name and the file name

and

  revision 1.13
  date: 2003/08/01 22:48:24;  author: neroden;  state: Exp;  lines: +1 -0
        * fixinc/inclhack.def (broken_cabs): Make matching more generous.
        * fixinc/fixincl.x: Regenerate.
        * fixinc/tests/base/math.h: Regenerate to match test_text change.

which lead me to the following:

  revision 1.160
  date: 2003/07/09 21:00:01;  author: neroden;  state: Exp;  lines: +3 -2
        * fixinc/inclhack.def (math_exception):  Improve bypass and comment.
        * fixinc/fixincl.x: Rebuild.

Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -3 -p -r1.159 -r1.160
--- inclhack.def        8 Jul 2003 20:42:19 -0000       1.159
+++ inclhack.def        9 Jul 2003 21:00:01 -0000       1.160
@@ -1680,7 +1680,8 @@ fix = {


/* - * Some math.h files define struct exception, which conflicts with + * Some math.h files define struct exception (it's in the System V + * Interface Definition), which conflicts with * the class exception defined in the C++ file std/stdexcept.h. We * redefine it to __math_exception. This is not a great fix, but I * haven't been able to think of anything better. @@ -1692,7 +1693,7 @@ fix = { hackname = math_exception; files = math.h; select = "struct exception"; - bypass = 'We have a problem when using C\+\+'; + bypass = '__cplusplus'; c_fix = wrap;

c_fix_arg = "#ifdef __cplusplus\n"


If it is still there, then either the fix does not trigger on the real
header but does on the test,
This seems likely, actually -- I made the bypass more generous so that it will be bypassed on more systems. It's quite possible that the Solaris header claims to be c++-aware but doesn't do it correctly; I seem to remember something to that effect elsewhere.

* What was the original failure when using math.h with C++ on Solaris 9?
* Is Solaris 9's math.h properly guarded with #ifdef __cplusplus?
* Does it contain the text "__cplusplus"?
If it contains the text and isn't properly guarded, we have a winner.  :-(

or else someone committed an inclhack
change without running the fixinc ``make check'' on the result.


From my results above, it seems that Nathanel indeed only ran the
test weeks after making the patch.  fixinc is black magic to me, but
might that be the culprit?


Just from inspection, there are *two* patches related to exceptions:

sunos_matherr_decl and math_exception

but I do not see how they could interact on the header in question.
They should be re-ordered, though.  It looks like the second fix would
put a ``struct exception;'' in before the ``#ifdef __cplusplus'' thing.
(The bypass clause should prevent the application of the fix on the
header in question:


Hmm, that one's definitely a bit too steep for me. :-)

If there's any patch you'd like me to test, or any (header) file you'd
like me to send, I'll happily do that, though.

Gerald



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