Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!uunet!amgraf!huver From: huver@amgraf.UUCP (Huver) Newsgroups: comp.sys.amiga.programmer Subject: Re: Is it me or Manx C 5.0c (the -MR option) Summary: fabs() vs. FABS() Message-ID: <414@amgraf.UUCP> Date: 6 Mar 91 06:25:02 GMT References: <46418@nigel.ee.udel.edu> <13377@hubcap.clemson.edu> Organization: Amgraf Inc., Kansas City Lines: 44 cgehman@hubcap.clemson.edu (Corey Gehman) wrote: >Well, my problem didn't get fixed with the -so option. Here's the >smallest I could convert the problem down to: > > >#define FABS(x) ((x) < 0.0 ? (0.0 - (x)) : (x)) > >double test() >{ >double i,j; > > return (FABS ( i - j ) + FABS ( i - j ) + FABS ( i - j )); >} > ... > > I've "fixed" the problem by using a subroutine instead of a macro > but since I often port software from unix to the amiga I don't want > to do that everytime. I don't know if 5.0d version with the -so > option works or not. Now I'm not picking on you, but for the particular example, do: #include #define FABS(x) fabs(x) /* rest of your code */ and it works just fine; in fact I'd change all FABS() to fabs() calls and forget about the macro form. The fabs() is a standard UNIX library function (System V) which, if you're bringing "software from unix", should've been used by the original code. Whatever your UNIX, grep fabs from and see. The Manx bug is quite interesting though. With 5.0d/e on your posted code as is, the -f8 (881 code) option generates absolutely no problem whatsoever, all other -fX options fail. Looks like a compiler intended for 020/881 as a standard platform. :^) -huver