Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Help me cast this!: Ultrix 2.x bug Message-ID: <11344@mimsy.UUCP> Date: 4 May 88 05:20:17 GMT References: <294@fedeva.UUCP> <1451@iscuva.ISCS.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 27 Keywords: pointer to array of struct context: struct outfile (*output)[] = <>malloc(sizeof(struct outfile) * 3); ---what to use for <>: In article <1451@iscuva.ISCS.COM> carlp@iscuva.ISCS.COM (Carl Paukstis) writes: > output = (struct outfile **)malloc(sizeof(struct outfile) * 3); > >works on Ultrix 2.something .... ... but only because of a compiler bug. Obviously DEC have not installed Guy Harris's fixes to chkpun() in mip/trees.c. [lint complains] >"possible pointer alignment problem" ... 4.3BSD `man lint': BUGS There are some things you just can't get lint to shut up about. This is one of them. malloc() returns a maximally-aligned pointer, but lint does not know, and cannot be told. (There may be smarter lints that can be told; ours can also be improved. Meanwhile, I tend to run all lint output through `grep -v "possible pointer alignment problem"'.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris