Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!newstop!texsun!texbell!nuchat!moray!urchin!p6.f506.n106.z1.fidonet.org!Bob.Stout From: Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) Newsgroups: comp.lang.c Subject: Re: lint won't verify printf formatting against variable types?? Message-ID: <16399.24B11BBE@urchin.fidonet.org> Date: 4 Jul 89 08:36:51 GMT Sender: ufgate@urchin.fidonet.org (newsout1.26) Organization: FidoNet node 1:106/506.6 - Fulcrum's Edge, Spring TX Lines: 12 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.