Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!husc6!linus!jgb From: jgb@linus.UUCP (Jonathan G. Bressel) Newsgroups: comp.lang.c Subject: lint on malloc calls Keywords: malloc lint pointer Message-ID: <39617@linus.UUCP> Date: 8 Sep 88 20:12:38 GMT Reply-To: jgb@linus.UUCP (Jonathan G. Bressel) Organization: The MITRE Corporation, Bedford MA Lines: 23 What is the best way of using malloc to get a pointer to a structure? I am using the line below: nextentry = (entry *) malloc(sizeof(entry)); where nextentry is defined as entry *nextentry; Running lint -bach yields: phone.c(61): warning: illegal pointer combination phone.c(61): warning: possible pointer alignment problem What am I doing wrong? Doesn't K+R suggest this on pp. 133-134 (at the end of section 6.5)? Thanks. -- Jonathan G. Bressel The MITRE Corporation MS E095, POB 208, ARPA: linus!jgb@mitre-bedford Bedford, MA 01730 UUCP: ...{decvax,utzoo,philabs,genrad}!linus!jgb (617) 271-2794