Path: utzoo!utgpu!attcan!uunet!ingr!crossgl From: crossgl@ingr.UUCP (Gordon Cross) Newsgroups: comp.lang.c Subject: Re: lint warning messages with malloc() Summary: malloc pointer warning from lint can be ignored Message-ID: <2816@ingr.UUCP> Date: 3 Nov 88 14:02:19 GMT References: <142@cjsa.WA.COM> Organization: Intergraph Corp. Huntsville, Al Lines: 17 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 The warning that lint is giving you is based on the fact that you are casting a character pointer (returned from malloc) into another pointer type having more stringent alignment requirements. Malloc does guarantee that all pointers it returns are properly aligned to use with any data type but lint does not assume this since "malloc" is just another function (you could write your own version you know). Your best bet is to just ignore the warning since you are NOT in reality going to have any problems from this! Gordon Cross Intergraph Corp. Huntsville, AL