Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!anasaz!duane From: duane@anasaz.UUCP (Duane Morse) Newsgroups: comp.unix.programmer Subject: Re: hiding lint's ravings (was Re: FAQ - malloc array - clarify) Summary: Two suggestions Keywords: malloc, Sun, lint Message-ID: <2985@anasaz.UUCP> Date: 8 Sep 90 21:35:28 GMT References: <8056@helios.TAMU.EDU> <1990Sep08.022034.8444@virtech.uucp> <8086@helios.TAMU.EDU> Organization: Anasazi Inc., Phoenix AZ Lines: 19 Here are two suggestions to remove lint's pointer alignment complaint. 1) Put #ifdef lint/#endif around the code and do something innocuous when running lint. If the profs read the code carefully, this may raise their eyebrows. 2) Write your own "malloc" subroutine which returns 0 for success and a nonzero value for failure; pass a pointer to where you want to store the address and have the routine interpret it as a char **; use a variable of the type you really need (struct whatever *) and cast it to (char **) in the subroutine call -- lint won't complain about any of this. By the way, if the prof's really complain about this lint 'error' in your program, it doesn't say much about their knowledge of lint. -- Duane Morse e-mail: duane@anasaz (or ... asuvax!anasaz!duane) (602) 861-7609