lint won't verify printf formatting against variable types??

Bob Stout Bob.Stout at p6.f506.n106.z1.fidonet.org
Tue Jul 4 18:36:51 AEST 1989


In an article of <28 Jun 89 15:13:00 GMT>, (Edward J Driscoll) writes:

 >It is legal, but I would hope for a warning from such an obvious
 >semantic error.  I don't use lint much, but Borland TC 2.0 will
 >warn you about some *legal* constructs like "if(x = 5)".  Oddly, I
 >just tried it and it also lets "if(x==5);" get by without a peep.

  See my previous message on the semicolon issue. As to `if (x = 5)', I   
thought most C programmers nowadays always wrote the constant part of a  
logical comparison on the left side as a regular issue of style. Writing
`if (5 = x)' instead would allow the preprocessor to catch your mistake for   
you. 



More information about the Comp.lang.c mailing list