Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!oliveb!pyramid!infmx!greggy From: greggy@infmx.UUCP (greg yachuk) Newsgroups: comp.lang.c Subject: Re: lint on malloc calls Keywords: malloc lint pointer Message-ID: <419@infmx.UUCP> Date: 9 Sep 88 18:36:51 GMT References: <39617@linus.UUCP> Reply-To: greggy@infmx.UUCP (greg yachuk) Organization: Informix, Menlo Park, Ca. U.S.A. Lines: 34 In article <39617@linus.UUCP> jgb@linus.UUCP (Jonathan G. Bressel) writes: > nextentry = (entry *) malloc(sizeof(entry)); > >Running lint -bach yields: > > phone.c(61): warning: illegal pointer combination > phone.c(61): warning: possible pointer alignment problem Most likely, you have a somewhat advanced lint that understands that int's and pointers do not need to be the same size. If you have no previous definition for malloc, it defaults to returning an int. Lint might not be impressed when you try to cast this to a pointer. If you #include (or whatever is appropriate for your compiler), this complaint will likely go away. Alternatively, you could code your own definition: void *malloc(); or char *malloc(); >Thanks. You're welcome (I hope this is correct!!??) >-- >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 Greg Yachuk Informix Software Inc., Menlo Park, CA (415) 322-4100 {uunet,pyramid}!infmx!greggy why yes, I DID choose that login myself Yes, yes hammerheads; swimming, kissing; we are big and clever and we don't know anything! God save hammerheads; keeping going; we are sleek and special, and we're sure of something