Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: dead code, brain dead lilbrary Message-ID: <10294@hoptoad.uucp> Date: 17 Feb 90 01:01:11 GMT References: <1990Feb14.204332.24800@caen.engin.umich.edu> <20062@bellcore.bellcore.com> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 26 In article <20062@bellcore.bellcore.com> sdh@flash.UUCP (Stephen D Hawley) writes: >Yes, it removes dead code, but the ANSI library is pretty darn stupid when >it comes to the atomicity of the libraries. Actually, as I've pointed out, THINK C only removes dead code in restricted cases --- when project files are used as libraries, and when an entire source file is unused. MPW Link removes all unreferenced routines. >Ok, quiz question: >How many of you can write/have written atoi()? I have. It was a mistake. Eventually I threw it away. You should use NumToString and StringToNum. Any "atoi" you write will almost certainly be unfriendly in international environments. The one you gave is. The proper way to write atoi on the Macintosh is: int atoi(StringPtr s) { long i; StringToNum(s, &i); return i; } -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Philosophy is the talk on a cereal box Religion is the smile on a dog" -- Edie Brickell, "What I Am"