Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!botter!tjalk!rblieva From: rblieva@cs.vu.nl (Roemer b Lievaart) Newsgroups: comp.lang.c Subject: lint (was: Re: goto's and switch statements -- mild proposal) Message-ID: <871@tjalk.cs.vu.nl> Date: Fri, 4-Sep-87 06:54:15 EDT Article-I.D.: tjalk.871 Posted: Fri Sep 4 06:54:15 1987 Date-Received: Sat, 5-Sep-87 16:55:48 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> Reply-To: rblieva@cs.vu.nl (Roemer B. Lievaart) Organization: VU Informatica, Amsterdam Lines: 26 Disclaimer: Me foreigner, me no english native! In article <712@spar.SPAR.SLB.COM> hunt@spar.UUCP (Neil Hunt) writes: >In article <869@tjalk.cs.vu.nl> I (that's me) wrote: > >Oh yeah? How about the message I get for EVERY casted malloc or realloc: > >:: somefile.c(007): warning: possible pointer alignment problem > >Can't shut lint up about that. ^^^^ >I don't know which compiler you are using, but on the compiler I use, ^^^^^^^^ >this warning is avoided if you make sure that the compiler knows that >malloc returns a pointer by declaring it (char *). Even if you then I was talking about LINT, not the compiler. And as you can see by the warning lint gave, it was NOT because I didn't declare malloc as (char *)(), because I did. >cast it into (something_else *), it accepts it, whereas if the compiler >thinks that [mc]alloc is (int), it will indeed issue this warning. ^^^^^^^^^^^^ If this is true, I would buy another compiler with more apropriate error messages! --Roemer (pronounce "Rumour") PS About the (pretty obvious, I now realise) (void)-thing you were ofcourse right. At last I understand what "void" is good for! :-\