This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: aix4.3 math.h header broken for cabs
- To: autogen at linuxbox dot com, bkoz at cygnus dot com, gcc-bugs at gcc dot gnu dot org
- Subject: Re: aix4.3 math.h header broken for cabs
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 1 May 2000 14:38:34 -0400 (EDT)
> From: Benjamin Kosnik <bkoz@cygnus.com>
>
> This needs to be fixed, as libstdc++-v3 uses the C9x signatures.
> Here's an attempt to fix it, by patching gcc/fixinc/inclhack.def. I'd
> rather just remove the entire declaration though (how do i do this)...
>
>
> 2000-05-01 Benjamin Kosnik <bkoz@cygnus.com>
>
> * fixinc/inclhack.def: Fix cabs on AIX.
>
> Index: inclhack.def
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/fixinc/inclhack.def,v
> retrieving revision 1.54
> diff -u -p -c -p -r1.54 inclhack.def
> cvs server: conflicting specifications of output style
> *** inclhack.def 2000/04/02 22:50:55 1.54
> --- inclhack.def 2000/05/01 17:59:34
> *************** fix = {
> *** 547,552 ****
> --- 547,565 ----
>
>
> /*
> + * Fix cabs declarations in math.h on AIX.
> + */
> + fix = {
> + hackname = aix_cabs;
> + files = "math.h";
> + files = "math.h";
> + select = 'double cabs()';
> + sed = 's/extern double cabs();/'
> + 'extern double cabs(__complex__ double x);/';
> + };
> +
> +
> + /*
> * Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
> */
> fix = {
>
I have a couple of comments.
1. Outright missing prototypes are usually handled via
sys-protos.h/fixproto/fix-header rather than fixincl. Perhaps we
should add entries to sys-protos.h for all the new c9x functions and
add a C9X_SYMBOL case to make use of them.
2. On my AIX4.1.1 system, cabs is prototyped with "struct dbl_hypot"
And only omits the arg if _NO_PROTO is defined. Isn't yours the same?
What happens if either fixincl or fixproto diddles the non-prototyped
version to use __complex__ and a user gets that prototype but calls
the libc function which takes struct dbl_hypot? We can't assume the
layout of __complex__ is the same as struct dbl_hypot can we?
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions