General

I suggest you ...

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  1. compute function cyclomatic complexity...

    ...and issue message if above a threshold.

    Since you're already analyzing the functions, it would seem to be a relatively minor addition to compute a cyclomatic complexity for the function (he said, while signing up someone else to do all the work).

    Then, similarly to the "-size" option, the user could be allowed to set a max complexity, above which an info message could be generated.

    This would help reduce our reliance on additional tools.

    1 vote
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
    • generate an Info message for inefficient structure packing

      Since PC-Lint already has the size and alignment information, it could determine if structures members are not arranged most efficiently.

      For example, in a standard 32-bit system, a structure defined as

      struct foo
      {
      uint32_t a;
      uint8_t b;
      uint16_t c;
      }

      is not most efficiently arranged, requiring an additional padding byte between b and c to achieve the necessary alignment for c. A more efficient method would be to define foo as

      struct foo
      {
      uint32_t a;
      uint16_t b;
      uint8_t c;
      }

      I think Lint could determine this and generate some Info message for struct name.

      1 vote
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
      • Consider adding reporting capabilities to PC-LINT Plus

        Most competing tools can generate MISRA compliance reports at the push of a button.
        With PC-LINT 9.0L it is a rather tedious procedure, e.g. running with ++efreeze, parsing text output and generating a result.
        Not up to date in 2017.

        6 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
        • Add option to show messages found in header file only once

          Consider this: a.h contains 10 problems and is included in 10 modules.
          That leaves you with 100 lint messages in the log, when in reality there are only 10 problems to fix.
          So, having an option that shows messages in header files only the first time it is included would be really cool (and more honest in terms of MISRA violations).

          11 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)
            You have left! (?) (thinking…)
          • Further improve value tracking to catch more out-of-bounds errors

            This one is straight from the discussion forum (http://www.gimpel.com/Discussion.cfm?ThreadID=5087) and not yet detected in PC-LINT Plus Beta 8c (i assumed because of the additional level of indirection):

            void main(void)
            {
            int array[4];
            int index = 0;
            for (int loop = 0; loop < 10; ++loop)
            {
            array[index] = loop;
            ++index;

            array[index] = loop;
            ++index;
            }
            array[0] = array[1];
            }

            2 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)
              You have left! (?) (thinking…)
            • Correct a possible oversight in the Warning 529 and/or 438 behavior

              If a character array is set to a value (using a function), which is never subsequently used or returned the WARNING 529 or WARNING 438 should be generated.

              Given the following file, main.c
              1 #include <string.h>
              2
              3 int main ( void )
              4 {
              5 int un1 = 0;
              6 char un2[10] = {0};
              7 char un3[10] = {0};
              8
              9
              10 strcpy(un2,"Hello");
              11
              12 return 0;
              13 }

              flexelint does not see the variable as unused below. Notice that Line 5 and Line 7 generate the 529, but line 6 is ignored. A 438 might work as well.

              5 votes
              Vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)
                You have left! (?) (thinking…)
              • else-branch with empty debug statement

                I have a lot of debug message options in my code.

                #ifdef DO_DEBUG
                #define DBG_INFO(txt) WriteLn(txt)
                #endif

                void foo(UInt16 a)
                {
                if (a != 0)
                {
                DoSomething();
                }
                else
                {
                DBG_INFO("a = 0");
                }
                }

                With Lint 9.00L I get a note "960" Violates MISRA 2004Required Rule 14.10, else-branch must have a comment or action.
                However, the else branch is not empty. It contains code that is just removed by the preprocessor.
                I have seen some similar effects with asm statements where for lint I have done:
                #define asm(txt)

                Only give a 960 note when the else branch is truly…

                1 vote
                Vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)
                  You have left! (?) (thinking…)
                  1 comment  ·  Admin →
                • Add an option to identify undefined behavior

                  The C99 standard (Appendix J) identifies almost 200 forms of undefined behavior (UB). For many, many reasons, UB is basically the most egregious form of coding error. It is totally preventable, and the effects can be most devastating.

                  Even though not all kinds of UB can be detected by a static analysis tool, many are, and other tools do this pretty well.

                  Piggy-backing onto this -- would also be nice to identify implementation-defined behaviors (e.g. bit position of bit-fields) and unspecified behaviors.

                  As these are all part of the standard, it doesn't seem too hard to do intellectually, it's just…

                  8 votes
                  Vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)
                    You have left! (?) (thinking…)
                  • Improved MISRA checking for projects with mixed C/C++ source code

                    According to chapter 5.7 of the manual, PC-LINT determines the language from the file extension.
                    Therefore, one could assume that in a mixed C/C++ project one would get MISRA C messages in C modules and MISRA C++ messages in C++ modules respectively.
                    In reality this is not working, even if you use the –indirect option to help PC-LINT:

                    common.h/* included in all modules to select MISRA standard based on language*/
                    #ifdef __cplusplus
                    /*lint –indirect(au-misra-cpp.lnt)*/
                    #else
                    /*lint –indirect(au-misra3.lnt)*/
                    #endif

                    Depending on the order of the modules processed, you end up with MISRA C messages in C++ modules and vice versa.
                    PC-LINT…

                    2 votes
                    Vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)
                      You have left! (?) (thinking…)
                      planned  ·  0 comments  ·  Admin →
                    • Using always same output format for all messages

                      When you use your own output format, that all messages has the same format.

                      When you use:
                      -"format=%f %l %t %n; %m"

                      some messages looks like:
                      0 Info 766; Header file 'C:\projects\temp.h' not
                      used in module 'C:\projects\test.c'

                      or

                      0 Info 714; Symbol
                      'e_Get_Internal_Extended(void)' (line 3988, file
                      C:\projects\test.c) not referenced

                      At this outputs I´m missing the file name and line number at beginn of the message. But there are known at the end of the messages.

                      It´s hard to write a clean error parser, when the output messages changes.

                      1 vote
                      Vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)
                        You have left! (?) (thinking…)
                      • Preprocessor output for a specific code section

                        The "-p run just the Preprocessor" option is very handy, but for me it often generates too much information to pour though when I'm trying to diagnose a specific macro issue.

                        It would be great if the preprocessor output could be enabled for a section of code, and send the output to a file and/or standard out.

                        e.g.:
                        //lint -p+
                        SOME_COMPLEX_MACRO(a,b,c,d,e);
                        //lint -p-

                        4 votes
                        Vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)
                          You have left! (?) (thinking…)
                          1 comment  ·  Admin →
                        • Display all options currently in effect (What Options am I using here)

                          Although "-vo" and "lint usual arguments ?" are useful, they produce a lot of information, including information that sometimes could be considered 'what was noise' such as temporary error suppressions "-save, -e123, -restore"

                          It would be great if you could add a feature where I could display all options, suppressions, flags, etc. in effect at a specific point in a source file that have been:
                          a) changed from the defaults, or
                          b) changed since the last "-save"
                          c) changed in this file

                          for example:
                          //lint -save
                          //lint -e123
                          //lint -esym(456, FooBar)
                          ...
                          /*lint -save -e789 */ MACRO /*lint -restore */ …

                          4 votes
                          Vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)
                            You have left! (?) (thinking…)
                            planned  ·  0 comments  ·  Admin →
                          • Specify precompiled header -pch .lph output directory

                            Currently, the xxx.lph precompiled header file is outputted/saved in the same directory as the xxx.h header file, which causes the (often very large) file to be unnecessarily included in source code only backups.

                            Ideally it would be possible to designate the directory that the .lph precompiled output file is stored in, such as the debug/release build object file directory or a temporary directory.

                            3 votes
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                            • documentation suggestion: sample function names

                              The documentation sometimes includes sample function names that can be misread as keywords/parameters, for example:
                              //lint -sem( push, custodial(1))
                              "push" is often a keyword, for example:
                              #pragma pack(push, 1)
                              #pragma warning(push)
                              the examples in the guide are great, but sample function names that look like they could be parameters is sometimes confusing for me.

                              Also, if the sample function names were odd-ball and had mixed case, I think it would be a bit clearer, such as FooBar, MyFunc

                              1 vote
                              Vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)
                                You have left! (?) (thinking…)
                              • Bitfield size isn't error checked by Lint

                                Greetings,
                                I've been using Lint for the past 5 years and it's been a very useful tool for me. However, today I discovered an error in my C code that wasn't caught by Lint, and it may be useful if it could be flagged. The error is trying to divide a variable in a structure definition into bitfields where the combined size of the bitfields exceeds the size of the underlying variable.

                                For example, my bad code was like this:

                                typedef struct dummy_struct
                                {
                                unisgned char field1: 6,
                                field2: 6,
                                field3: 1,
                                field4: 1;
                                } DUMMY;

                                So, basically, I was…

                                2 votes
                                Vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)
                                  You have left! (?) (thinking…)
                                • Use a fixed release cycle

                                  Customers could plan better, if they knew you have 2 or 4 releases per year.
                                  Right now it´s totally unpredictable.

                                  4 votes
                                  Vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)
                                    You have left! (?) (thinking…)
                                    planned  ·  0 comments  ·  Admin →
                                  • Add support for pthread_mutex_trylock() semantics

                                    As described in http://www.gimpel.com/Discussion.cfm?ThreadID=3793 this functionality is needed.

                                    For example, this function results in lint warning 455 (A thread mutex that had not been locked is being unlocked):

                                    bool IsLocked()
                                    {
                                    int retStat = pthread_mutex_trylock(&m_pthreadMutex);
                                    if (retStat == 0)
                                    {
                                    // Mutex was not locked, but is now.
                                    pthread_mutex_unlock(&m_pthreadMutex);
                                    return (false);
                                    }
                                    else if (retStat == EBUSY)
                                    {
                                    // Mutex is already locked.
                                    return (true);
                                    }
                                    return (false);
                                    }

                                    12 votes
                                    Vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)
                                      You have left! (?) (thinking…)
                                    • Allow Lint to see that constructor takes ownership of memory.

                                      Lint sees that ownership of allocated memory is taken by a constructor if the owning object isn't "new'd". But if the owning object is "new'd", then Lint does not understand this. See the example below, which works in the online demo.

                                      This was discussed in this thread, as well as several others:
                                      http://www.gimpel.com/Discussion.cfm?ThreadID=808

                                      //lint -e438, -e529, -e1502, -e1712, -e1788, -e714
                                      #include <memory>

                                      struct A { A(char *){}; };
                                      void g( )
                                      {
                                      // This results in a 429 warning.
                                      char * ptr1 = (char *) malloc(10);
                                      A *a1 = new A(ptr1);

                                      // This does not result in a 429 warning. …

                                      16 votes
                                      Vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)
                                        You have left! (?) (thinking…)
                                        planned  ·  0 comments  ·  Admin →
                                      • Relax warning 747 for literals

                                        Given this code:

                                        #include <stdio.h>
                                        #include <string>

                                        void test()
                                        {
                                        std::string mystr("Hello World");
                                        char c;

                                        c = mystr[1];
                                        printf("char: %c", (int)c);
                                        }

                                        Lint produces this output:

                                        c = mystr[1];
                                        main.cc 9 Info 747: Significant prototype coercion (arg. no. 1) int to
                                        unsigned log

                                        It seems unreasonable for this message to be emitted for a literal. The compiler obviously will convert to the properly sized argument.

                                        1 vote
                                        Vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)
                                          You have left! (?) (thinking…)
                                        • Add appended messages to the save/restore concept

                                          We are linting our complete software with different rulesets for its different SW-parts (because some are safety relevant and some are not, i.e. the rulesets differ, but the code analysis must check the software as a whole).

                                          Each SW-part's rulesets has its own active rules/errors + specific messages for the errors, which are added via the "-append()" option.
                                          In the course of action we use the save/restore options to get back to a basic common, global configuration.

                                          I.e. the complete command line is something like:
                                          # lint-nt.exe
                                          # <output file>
                                          # <global base cfg>
                                          # <msg output format cfg>.lnt
                                          #…

                                          3 votes
                                          Vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)
                                            You have left! (?) (thinking…)
                                            planned  ·  0 comments  ·  Admin →
                                          ← Previous 1
                                          • Don't see your idea?

                                          General

                                          Feedback and Knowledge Base