Path: utzoo!mnetor!uunet!husc6!bbn!gatech!emcard!fedeva!wrd3156 From: wrd3156@fedeva.UUCP (Bill Daniels) Newsgroups: comp.lang.c Subject: Help me cast this! Message-ID: <294@fedeva.UUCP> Date: 2 May 88 22:09:28 GMT Organization: Federal Express Corp., Memphis, TN Lines: 44 Keywords: pointer to array of struct How do I cast the malloc() in line 12 of the following program to avoid the lint cries of "warning: illegal pointer combination" et al? My system is a Perkin-Elmer 3210 running SYS V rel. 2. I have tried "all but one" of every combination of casts known to mankind. Help me find the only one left, the one that works! #include main() { char *malloc(); int i; struct outfile { int j; int k; } (*output)[]; output = malloc(sizeof(struct outfile) * 3); (*output)[0].j = 1; (*output)[0].k = 2; i = printf("%d %d\n",(*output)[0].j,(*output)[0].k); return(i); } THIS IS MY LINT'S OUTPUT: trial.c ============== warning: illegal pointer combination (12) warning: possible pointer alignment problem (12) Thanks for any assistance! -- bill daniels federal express, memphis, tn {hplabs!csun,gatech!emcard}!fedeva!wrd3156