Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.lang.c,news.software.b Subject: Re: passing NULL to functions Message-ID: <1129@ius2.cs.cmu.edu> Date: Sun, 26-Apr-87 21:12:25 EDT Article-I.D.: ius2.1129 Posted: Sun Apr 26 21:12:25 1987 Date-Received: Tue, 28-Apr-87 02:35:44 EDT References: <150@sds.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 27 Summary: (Huh?) Xref: mnetor comp.lang.c:1920 news.software.b:554 In article <150@sds.UUCP>, dave@sds.UUCP (dave schmidt x194) writes: > > In article <5794@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > > In article <888@viper.UUCP> john@viper.UUCP (John Stanley) writes: > > will break on some systems. The problem is that the widths of pointers > > of various types are in general different (and different from an (int)), > > Are you saying that you are not guarenteed sizeof(char *) == sizeof(int *) sizeof(long *) == sizeof(whatever *)? I'm amazed at this because I have never run across this problem but then again I haven't worked on that many different architectures. Not that I doubt you, but could you show me where you benifit or need pointers of different size? > > #define ALLOC(type, qty) ((type *)calloc((qty), sizeof(type))) > Dave Schmidt I prefer: #define alloc(type) ((type *) malloc(sizeof(type))) #define alloc_array(type,size) ((type *) malloc(sizeof(type)*size)) #define mfree(x) free(x) /* helps when debugging malloc problems */ -- Eddie Wyatt