Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: Dumb question on dyn. mem. alloc (if(hate(novices)) dont_read();) Message-ID: <5802@utzoo.UUCP> Date: Fri, 19-Jul-85 11:58:27 EDT Article-I.D.: utzoo.5802 Posted: Fri Jul 19 11:58:27 1985 Date-Received: Fri, 19-Jul-85 11:58:27 EDT References: <1035@homxa.UUCP> Organization: U of Toronto Zoology Lines: 22 > ... It seems that no > matter how I declare the function calloc() or how I typecast in > the returned pointer, I get a warning from lint that I have > a "possible pointer alignment problem." ... what problems > am I going to run into and how can I fix them (or should I just > ignore the the message)? Ignore the messages. Lint is saying "you are casting one kind of pointer to another, and this is an area where portability problems can occur"; it doesn't know that malloc() and friends are a special case where this sort of thing is guaranteed to be safe. This particular message is enough of a pain that the "lint" entry in the Makefile for any program of mine that uses malloc() a lot tends to read something like: lint foo bar bletch | egrep -v 'possible pointer alignment' One should do this sort of thing with fear and trepidation, but it is unfortunately true that *real* lint problems are much easier to spot when they aren't buried in a river of meaningless complaints about malloc(). -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry