boy was this annoying. it took me a while to track down a bug in my app to
the Abs() macro not working correctly! maybe this is a FAQ, but it was new
to me.
in sysutil.h, Abs is defined as:
#define Abs(a) ((a >= 0) ? a : (-a))
Doh!!!! that's wrong. the left paren should come after the minus sign, and
there should be parens around the second "a":
#define Abs(a) ((a >= 0) ? (a) : -(a))
otherwise, then compiler cannot correctly evaluate something like "Abs(foo -
bar)", etc.
- Re: Abs() macro in sysutil.h is incorrect Chris Antos
- Re: Abs() macro in sysutil.h is incorrect Mark Nudelman
- Re: Abs() macro in sysutil.h is incorrect rflores
- RE: Abs() macro in sysutil.h is incorrect Richard Hartman
- RE: Abs() macro in sysutil.h is incorrect Mike Pellegrino
- RE: Abs() macro in sysutil.h is incorrect B. Flaumenhaft
- RE: Abs() macro in sysutil.h is incorrect Richard Hartman
- Re: Abs() macro in sysutil.h is incorrect Chris Antos
- Re: Abs() macro in sysutil.h is incorrect Nathan J. Williams
- RE: Abs() macro in sysutil.h is incorrect Mike Pellegrino
