Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!abvax!iccgcc!browns From: browns@iccgcc.decnet.ab.com (Stan Brown, Oak Road Systems) Newsgroups: comp.lang.c Subject: Re: Seven Original Sins of K&R (Long) Message-ID: <1283.270b385a@iccgcc.decnet.ab.com> Date: 4 Oct 90 18:25:43 GMT References: <12780@sdcc6.ucsd.edu> <1990Sep26.163927.26084@dg-rtp.dg.com> <1990Sep26.193626.721@phri.nyu.edu> <1990Sep27.073730.26575@warwick.ac.uk> <1990Sep27.131329.26616@phri.nyu.edu> <1990Sep28.144753.23727@zoo.toronto.edu> <3945@se-sd.SanDiego.NCR.CO Lines: 34 M> Followup-To: > Lines: 29 WARNING: Nit about to be picked. In <1990Sep28.144753.23727@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >>In article <1990Sep27.131329.26616@phri.nyu.edu> roy@phri.nyu.edu (Roy Smith) writes: >>>... I meant to >>>write: >>> >>>#define NULL (""[0]) > >Roy, apart from not being a compile-time value, which limits its use, >this is exactly and precisely equivalent to > >#define NULL 0 Not exactly or precisely. Every time the first version is invoked, it creates a separate instance of a one-byte string. So you chew up static data storage. Depending on how your compiler does alignmnet, it may be two or four bytes each time--or more. And in large model with Microsoft C, some combinations of options could put each "" in its own data segment! Is that horse dead yet? Lord knows I've been beating it enough! :-) The above is my own opinion and not attributable to any other person or organization. email: browns@iccgcc.decnet.ab.com Stan Brown, Oak Road Systems, Cleveland, Ohio, U.S.A. (216) 371-0043