Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!aurora!labrea!decwrl!spar!hunt From: hunt@spar.SPAR.SLB.COM (Neil Hunt) Newsgroups: comp.lang.c Subject: Re: goto's and switch statements -- mild proposal Message-ID: <712@spar.SPAR.SLB.COM> Date: Wed, 31-Dec-69 18:59:59 EDT Article-I.D.: spar.712 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Sat, 5-Sep-87 11:41:24 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> <916@haddock.ISC.COM> <929@haddock.ISC.COM> <867@mcgill-vision.UUCP> <869@tjalk.cs.vu.nl> Reply-To: hunt@spar.UUCP (Neil Hunt) Organization: Schlumberger Palo Alto Research - CASLAB Lines: 28 In article <869@tjalk.cs.vu.nl> rblieva@cs.vu.nl (Roemer B. Lievaart) writes: >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 cast it into (something_else *), it accepts it, whereas if the compiler thinks that [mc]alloc is (int), it will indeed issue this warning. >BTW. Does anybody know how to stop lint complaining about functions >returning values wich are always/sometimes ignored? I get one for every >time I use sprintf, fclose, strcpy and quite a few others! >[ OK, I meant another way than indeed using the values. > I just don't need them (always)! ] Tell lint explicitly that you know that a value is returned, but you are discarding it by calling the function with a (void) cast: char *sprintf(); (void)sprintf(buffer, "%d", i); Neil/.