Path: utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!tut!hydra!hylka!teittinen From: teittinen@cc.helsinki.fi Newsgroups: comp.lang.c Subject: Re: turbo-C and lint ? Message-ID: <2156.26078bf1@cc.helsinki.fi> Date: 21 Mar 90 14:13:04 GMT References: <1964@bruce.OZ> <1990Mar20.130947.16583@cs.eur.nl> <1966@bruce.OZ> Organization: University of Helsinki Lines: 26 In article <1966@bruce.OZ>, alanf@bruce.OZ (Alan Grant Finlay) writes: > 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? Why are you using old style function definitions, if you're interested of getting rid of bugs? If you write the check function again using ANSI-style function definition (void check(long x, char *y)) the compiler does automatic type conversion and no errors occur. Why make easy things difficult? -- E-Mail: teittinen@finuh.bitnet ! "Studying is the only way teittinen@cc.helsinki.fi ! to do nothing without Marko Teittinen, student of computer science ! anyone blaming you" -me