abs (was: volatile isn't necessary, but it's there)

Lawrence V. Cipriani lvc at tut.cis.ohio-state.edu
Sat Apr 9 13:11:36 AEST 1988


In article <7629 at brl-smoke.ARPA>, gwyn at brl-smoke.ARPA (Doug Gwyn ) writes:
> In article <10068 at tut.cis.ohio-state.edu> lvc at tut.cis.ohio-state.edu (Lawrence V. Cipriani) writes:
> Well, if <math.h> is where it belongs, why isn't it there on UNIX
> systems?

Well, it should be.  There are plenty of examples of missing "things"
on UNIX systems that saying "Why isn't it there" doesn't mean much.
For example, there is a system call (whose name escapes me - perhaps
it's times()) that fills in a structure that looks something like:

	struct something_or_other
	{
		time_t tm_ctime;
		time_t tm_mtime;
	};

(the names are probably wrong).  Anyway, the point is this struct
is not declared in a header file anywhere in UNIX, it should be though.
Lint makes a lot of noise about type conflicts when you use this
struct, (hey ATT-IS, fix this!)

> All you have uncovered is an error in the Rationale document.
> abs() was never in <math.h>, not in UNIX and not in the /usr/group
> 1984 Standard which served as the base document for the library.
> 
> I will ask the Rationale editor to correct his document.

Thank you.

> P.S.  I don't know of anybody who uses the abs() library routine;
> we all use a macro instead.  I would be happy if abs() were not
> required at all.

Likewise.  My main gripe was that the standard was going to change
an "existing" header file to cater to vendors.  Since abs() is not
in <math.h> there isn't much to say.  We could argue about putting
it in, but I'd just as soon not.

-- 
Larry Cipriani, AT&T Network Systems and Ohio State University
Domain: lvc at tut.cis.ohio-state.edu
Path: ...!cbosgd!osu-cis!tut.cis.ohio-state.edu!lvc (weird but right)



More information about the Comp.lang.c mailing list