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]

How does one identify HP-UX with broken inline math funs?



Here is the issue:  Apparently, HP-UX in some collection of versions
requires this fix to /usr/include/math.h:

  /*
   *  get rid of bogus inline definitions in HP-UX 8.0
   */
  fix = {
    hackname = hpux8_bogus_inlines;
    files    = math.h;
    select   = inline;
    bypass   = 'The Santa Cruz Operation';
    sed = "s@inline int abs(int [a-z][a-z]*) {.*}@extern \"C\" int abs(int);@";
    sed = "s@inline double abs(double [a-z][a-z]*) {.*}@@";
    sed = "s@inline int sqr(int [a-z][a-z]*) {.*}@@";
    sed = "s@inline double sqr(double [a-z][a-z]*) {.*}@@";
  };

I have temporarily added the `bypass' clause.  Since the actual
text that gets deleted should normally work in a reasonable
environment:

  inline int abs(int i) {return (i > 0) ? i : -i;}
  inline double abs(double d) {return fabs(d); }

it seems clear that we do not want to delete this text.
Since SCO is dead when these inlines are removed, I added
the bypass.  My preferred solution is to constrain the
fix to just those systems that need it.  (viz., HP-UX 8.0)

How?  Robert Lipe suggests:

> $ uname -a
> HP-UX udihp B.10.10 B 9000/816 946328291 16-user license
> 
> There are no copyright strings.  Maybe '_INCLUDE_HPUX_SOURCE'
> is enough of a clue.  Dunno.

Comments?

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