aix4.3 math.h header broken for cabs

Benjamin Kosnik bkoz@cygnus.com
Mon May 1 11:01:00 GMT 2000


C9X defines these signatures for complex absolute value:

7.3.8 Power and absolute-value functions 
7.3.8.1 The cabs functions 

Synopsis 1 #include <complex.h> 
double cabs(double complex z); 
float cabsf(float complex z); 
long double cabsl(long double complex z);

This can be represented by the following:

double cabs (__complex__ double x);
float cabsf (__complex__ float x);
long double cabsl (__complex__ long double x);




Unfortunately, aix 4.3 has this in math.h:

> /usr/include/math.h
> [snip]
> extern     double   cabs();
> [snip]

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 = {


More information about the Gcc-bugs mailing list