Path: utzoo!mnetor!uunet!husc6!rutgers!gatech!ncar!ames!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: abs (was: volatile isn't necessary, but it's there) Message-ID: <3388@haddock.ISC.COM> Date: 10 Apr 88 21:55:21 GMT References: <7794@alice.UUCP> <10068@tut.cis.ohio-state.edu> <3377@haddock.ISC.COM> <10171@tut.cis.ohio-state.edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 19 In article <10171@tut.cis.ohio-state.edu> lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) writes: >In article <3377@haddock.ISC.COM>, karl@haddock.ISC.COM (Karl Heuer) writes: >> I just checked two systems (one BSD, one USGish), and neither declares the >> abs() function in any header. (Why should they? The default declaration >> suffices.$) > >What default declaration suffices for what? The argument types need to >be declared with a function prototype. I could live without abs() being >in as long as it was in *some* header files. The default declaration, "extern int abs();", which is automatically generated by the compiler for any function which is used without a declaration in scope, suffices on the two systems I mentioned, because (having no ANSI compiler nor any other notion of prototypes) it conveys the same information as an explicit declaration. With ANSI C, the declaration becomes useful (assuming you find automatic argument type conversion useful) and indeed it has an associated header (as do all standard functions). Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint