Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!mephisto!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!eurtrx!euraiv1!reino From: reino@cs.eur.nl (Reino de Boer) Newsgroups: comp.lang.c Subject: Re: turbo-C and lint ? Keywords: PD lint Message-ID: <1990Mar21.110835.29391@cs.eur.nl> Date: 21 Mar 90 11:08:35 GMT References: <1964@bruce.OZ> <1990Mar20.130947.16583@cs.eur.nl> <1966@bruce.OZ> Organization: Erasmus Universiteit Rotterdam, dept. CS (Informatica) Lines: 48 alanf@bruce.OZ (Alan Grant Finlay) writes: >Both of these were in reponse to my original query which may not have been >specific enough. Consider the following correct program: >check(x,y) >long x; >char *y; >{ >printf("%10.10s ",y); >} >main() >{ >check(10l,"testing"); >} >If you now remove the l after the 10 in the procedure call the compiler >issues no relevant warnings and the program misbehaves. Can Turbo-C >generate a warning for this kind of error? lint (Sun OS 4.0.3): -------------------- test.c(2): warning: argument x unused in function check check, arg. 1 used inconsistently test.c(4) :: test.c(9) printf returns value which is always ignored Turbo-C: -------- (Not exactly reproduced) Parameter x never used in function check Function should return a value in function check Function should return a value in function main We can conclude that Turbo-C's checking mechanism does not detect that parameter 'x' is used inconsistently, and that lint does not complain about the lack of return statements. Hope this answers your question, Reino P.S. Turbo-C also complains about the lack of prototypes for 'check' and 'printf'. -- Reino R. A. de Boer Erasmus University Rotterdam ( Informatica ) e-mail: reino@cs.eur.nl