Path: utzoo!utgpu!attcan!uunet!husc6!rutgers!cmcl2!phri!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.lang.c Subject: Re: lint warning messages with malloc() Message-ID: <355@marob.MASA.COM> Date: 3 Nov 88 13:34:48 GMT References: <142@cjsa.WA.COM> Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC New York City Lines: 22 In article <142@cjsa.WA.COM> jeff@cjsa.WA.COM (Jeffery Small) writes: >When compiling a program on an AT&T 3B1 (running SystemV.2 +/-), I am >getting the following warning message from lint when I use malloc(3): > > warning: possible pointer alignment problem >[...sample code deleted...] The program code is not at fault. The problem is that lint does not know about malloc returning a suitably aligned pointer, therefore it complains. You could do some fancy declaration footwork and declare X *malloc(); for the file, but be careful that there are no instances of any other malloc casts (including char *) within the same file. Most folks just ignore this warning when issued for malloc. Dave Hammond UUCP: ...!uunet!masa.com!{marob,dsix2}!daveh DOMAIN: daveh@marob.masa.com ----------------------------------------------------------------------------