Lint free program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Parul Bagadia
    New Member
    • Mar 2008
    • 188

    Lint free program

    What is the meaning of lint free program?
  • SpecialKay
    New Member
    • Mar 2008
    • 109

    #2
    Not sure, where did you hear that?
    If i had to guess, i would say no magic numbers. But that is 100% guess

    Comment

    • Parul Bagadia
      New Member
      • Mar 2008
      • 188

      #3
      Originally posted by SpecialKay
      Not sure, where did you hear that?
      If i had to guess, i would say no magic numbers. But that is 100% guess
      What do you mean by magic number? M hearing the word for the first time.

      Comment

      • Parul Bagadia
        New Member
        • Mar 2008
        • 188

        #4
        I read this term in the book of data structures. Where certain syntax was written and given that if we use it it will make our program lint free..
        I couldnt get its meaning in dictionary.

        Comment

        • Laharl
          Recognized Expert Contributor
          • Sep 2007
          • 849

          #5
          http://en.wikipedia.org/wiki/Lint_programming_tool 'lint free' is likely something that has no issues when checked by lint.

          Comment

          • SpecialKay
            New Member
            • Mar 2008
            • 109

            #6
            i was wrong, nothing to do with magic numbers.

            magic numbers are:

            case 1:
            [code=cpp]
            for(int i = 0; i < 9; i++)
            {
            print i;
            }
            [/code]
            In this case the number 9 is a magic number. it is proper to code this for loop:

            case 2:
            [code=cpp]
            int MAX_LOOP = 9;
            for(int i=0; i < MAX_LOOP; i++)
            {
            print i;
            }
            [/code]

            Comment

            • Laharl
              Recognized Expert Contributor
              • Sep 2007
              • 849

              #7
              Yep, Wikipedia has a pretty good explanation of that.

              Comment

              • Parul Bagadia
                New Member
                • Mar 2008
                • 188

                #8
                Originally posted by Laharl
                Yep, Wikipedia has a pretty good explanation of that.
                Thanx. i read it. And i understood it a bit.

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by Parul Bagadia
                  Thanx. i read it. And i understood it a bit.
                  Lint is an (almost) obsolete pre-ANSI-C tool; it checks conformance of a C
                  program accoring to the old K&R standard. It used to be handy but compilers
                  can do that job now, (for gcc set the -Wall warning flag).

                  kind regards,

                  Jos

                  Comment

                  • Banfa
                    Recognized Expert Expert
                    • Feb 2006
                    • 9067

                    #10
                    Originally posted by JosAH
                    Lint is an (almost) obsolete pre-ANSI-C tool; it checks conformance of a C
                    program accoring to the old K&R standard. It used to be handy but compilers
                    can do that job now, (for gcc set the -Wall warning flag).
                    Strictly speaking you mean well written compilers can do that now. There are plenty of platforms with less well written compilers that can still benefit from using lint.

                    Also most lint programs can perform cross source checks that a compiler is normally unable to do, that is a compiler normally only considers a single C or CPP file when compiling but lint can consider a group of files. For instance lint can tell you if an function declared with external linkage is not used which most compilers can't.

                    Comment

                    • JosAH
                      Recognized Expert MVP
                      • Mar 2007
                      • 11453

                      #11
                      Originally posted by Banfa
                      Strictly speaking you mean well written compilers can do that now. There are plenty of platforms with less well written compilers that can still benefit from using lint.

                      Also most lint programs can perform cross source checks that a compiler is normally unable to do, that is a compiler normally only considers a single C or CPP file when compiling but lint can consider a group of files. For instance lint can tell you if an function declared with external linkage is not used which most compilers can't.
                      Lint can't properly do that either: it has to be able to solve Turing's Halting Problem
                      to be able to determine whether or not a global function gets called.

                      kind regards,

                      Jos

                      Comment

                      Working...