Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Array indexing vs. pointers... Message-ID: <1988Oct5.204711.12099@utzoo.uucp> Organization: U of Toronto Zoology References: <836@proxftl.UUCP> <3105@hubcap.UUCP> <1700@dataio.Data-IO.COM> Date: Wed, 5 Oct 88 20:47:11 GMT In article <1700@dataio.Data-IO.COM> bright@dataio.Data-IO.COM (Walter Bright) writes: > o Replace int variables with unsigned where possible. This tells the > optimizer that the variable can never be negative... This can be a mistake on some machines, and I'm not sure how it would help very often. > o ... Use calloc instead of > malloc followed by zeroing each member. Mistake -- the semantics are not the same. Calloc fills with zero bits; that is not necessarily the same thing as zero values, especially for floating-point and pointers. -- The meek can have the Earth; | Henry Spencer at U of Toronto Zoology the rest of us have other plans.|uunet!attcan!utzoo!henry henry@zoo.toronto.edu