Thread: lint options

  1. #1
    Registered User
    Join Date
    May 2006

    lint options

    I noticed a program in MSVC with lint options. What are they actually used for, ignoring MSVC warnings? Is it smart to do this?

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    A lint program is a sort of code parser that checks many things in your code. It concerns itself with two main things: Syntax-Checking and Code Correctness.

    The first is a no-brainer. Your compiler does it. The second is much more interesting and tells you things like if you are placing the const keyword where you should, if you aren't using the canonical forms of some operator overloads, where are you using the so-called magic-numbers, etc...

    But lints can do much more than this. They can detect code that can be difficult to port to other systems, classes hierarchies that may be badly defined (DODs, inheritance abuse, copy-control problems etc...), they can detect code that will never run, code that may run forever, integrals that may overflow,... yadda yadda yadda... all the evil things we can do to ourselves and the compiler won't even care.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Lint is good. It is always wise. [edit]It is often described as, "a syntax checker on steroids."[/edit]
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Doxygen failing
    By Elysia in forum A Brief History of
    Replies: 19
    Last Post: 04-16-2008, 01:24 PM
  2. What's the best way to handle many program options?
    By stickmangumby in forum C Programming
    Replies: 19
    Last Post: 06-06-2007, 04:06 PM
  3. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM
  4. Greenhand want help!
    By leereg in forum C Programming
    Replies: 6
    Last Post: 01-29-2002, 06:04 AM
  5. Opening files - Giving options?
    By wwwGazUKcom in forum C++ Programming
    Replies: 3
    Last Post: 09-18-2001, 07:06 AM