This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fixinc regression for <math.h> with C++ on Solaris 9
- From: Bruce Korb <bkorb at veritas dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: Bruce Korb <bkorb at gnu dot org>, gcc at gcc dot gnu dot org, Eric Botcazou <ebotcazou at libertysurf dot fr>
- Date: Mon, 19 Jan 2004 12:38:06 -0800
- Subject: Re: fixinc regression for <math.h> with C++ on Solaris 9
- References: <Pine.BSF.4.58.0401192041300.85894@acrux.dbai.tuwien.ac.at>
- Reply-to: bkorb at veritas dot com
Gerald Pfeifer wrote:
>
> [ C++ gurus, below there is a four-liner which I believe to be
> valid C++, but a double check would be appreciated. ]
>
> Hi Bruce,
>
> the following difference between the fixincluded math.h on
> sparc-sun-solaris2.9 seems to be responsible for a regression:
>
> /sw/gcc-3.2.3/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3/include/math.h
> /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/include/math.h
> @@ -7,12 +7,6 @@
> This had to be done to correct non-standard usages in the
> original, manufacturer supplied header file. */
>
> -#ifndef FIXINC_WRAP_MATH_H_MATH_EXCEPTION
> -#define FIXINC_WRAP_MATH_H_MATH_EXCEPTION 1
> -
> -#ifdef __cplusplus
> -#define exception __math_exception
> -#endif
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.
If it is still there, then either the fix does not trigger on the real header
but does on the test, or else someone committed an inclhack change without
running the fixinc ``make check'' on the result. If it has been removed,
then you can determine the version it was removed in and look at the
associated inclhack.def change and try to find the cause.
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:
> fix = {
> hackname = sunos_matherr_decl;
> files = math.h;
>
> /* If matherr has a prototype already, the header needs no fix. */
> bypass = 'matherr.*(struct exception|__MATH_EXCEPTION)';
> select = matherr;
>
> c_fix = wrap;
> c_fix_arg = "struct exception;\n";
>
> test_text = "extern int matherr();";
> };
and from the Sol 9 header:
> /*
> * SVID
> */
> extern int matherr __P((struct exception *));