Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/02/09 22:17
Read: times


 
#165773 - Some examples
Responding to: ???'s previous message
is using while(1) more error prone than for(;;) no but for(;;) is the default

switch statements that fall though need // -lint fallthough to let lint know you meant it. The code is correct.
The warning or adding the fallthough is great since it means you had to verify it is correct.

LINT wants switch statements to have a default. even if it empty to prove to LINT you though about it. but the code it correct.

If a function has a return value that you do not use you must cast it void. Again to show LINT you know it returns something and are ignoring it on purpose.

If you follow LINTs rules your code will be less error prone. And that means less bugs. But some warnings are just warnings. As in this could be wrong, look at it and see.
To me some are pure style, and these have been done to the Nth degree in many internet forums and ANSI committees. So I will pass them here.



List of 15 messages in thread
TopicAuthorDate
PC Lint - Error 64            01/01/70 00:00      
   signed/unsigned            01/01/70 00:00      
      These are LINT Questions            01/01/70 00:00      
         First time with LINT?            01/01/70 00:00      
            Fair I think            01/01/70 00:00      
               The argument is            01/01/70 00:00      
                  Some examples            01/01/70 00:00      
                     There is no such thing as a benign warning            01/01/70 00:00      
         A question of dices            01/01/70 00:00      
            LINT has to deal with C            01/01/70 00:00      
               char != letter            01/01/70 00:00      
      Signed/unsigned char            01/01/70 00:00      
      signed/unsigned            01/01/70 00:00      
         Show it!            01/01/70 00:00      
   How to post legible source code            01/01/70 00:00      

Back to Subject List