General

  1. Find message inhibitions inside files that have no effect

    Sometimes the following happens:
    Code is created with a deliberate violation of a lint message.
    The message in inhibited with a comment in the code.
    However, it often happens comments are not updated with code.
    So the reason for the inhibition may be removed and the inhibition stays.

    It would be nice to find such "broken" inhibitions, (that have no effect on the resulting messages even when all other inhibitions are disabled).
    Maybe this search can be a result of executing pc-lint with a special flag.

    This way the code can be cleaned of old inhibitions.

    49 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  2. 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).

    18 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  3. 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);
    }

    17 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  4. 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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    planned  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  5. Detect -e Options and -save without -restore

    -e Options without surrounding -save/-restore in the same file shall be warned.
    Also a -save without -restore in the same file or same block level shall be warned.

    15 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →

    In PC-lint Plus, suppression options inside a source module do not “leak” to subsequent modules so this is less of an issue for PC-lint Plus than it was for PC-lint but we do plan to add a warning for -save options that do not have corresponding -restore options in a future update to PC-lint Plus.

  6. 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…

    13 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  7. C99: bool assignment error

    //lint -A(C99)
    typedef unsigned char uint8;
    typedef _Bool bool;

    const uint8 a = 100;
    const uint8 b = 200;
    int main(void)
    {
    bool test;
    test = (a==b);
    }
    Report error 1564 or 921 (cast from int to bool)

    Lint should know that the assignment of
    test = (a==b) is save on C99.
    Additionally, in our case it could not be deactivated by -estring(921,"cast from int to bool")

    12 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  8. 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.

    10 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    planned  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  9. Missing data overrun detection

    We had a construction like;
    len = strlen(value);
    p = malloc(len)
    strcpy(p, value)

    since we allocate 1 byte too little the strcpy will always cause a buffer overrun. But lint 9.00k did not detect it. Since this was only called with data read from files, it was detected when I added a call where value was a string literal

    It seems like lint is good in arithmetic and less good in algebra
    When it have a string literal of a known length it correct calculates the overrun, but if value is of unknown length it can't deduct that the overrun…

    9 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  10. Don't lock files during linting (windows, parallel builds)

    Lint open files on windows with file locking. This is the default method on windows. I suppose that lint uses fopen instead of OpenFile.
    This breaks the possibility to use parallel builds for speed up reasons on code that share some code base.
    Suggestion: Use OpenFile with OF_SHARE_DENY_NONE to allow other lint instances and other programms to access that file. If you are worried about file deletion, use at least OF_SHARE_DENY_WRITE.

    9 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  11. 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.

    11 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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…

    7 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    planned  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  13. Resolve the "correlated variables" problem in value tracking

    In some code constructs, value tracking can become confused by mutually-exclusive code paths. This is also known as the "correlated variables" problem, and can cause erroneous Warning 661 (pointer access out of bounds) alerts.

    I'd like to see PC-Lint be given the ability to determine mutually-exclusive code paths and remove these spurious warnings.

    The following code sample demonstrates this:

    #include <stdbool.h>
    #include <stdint.h>
    #include <string.h>

    /*lint ++fan ++fas*/
    typedef struct {
    uint8_t One0[2];
    uint8_t Two;
    uint8_t One2[2];
    } DATA_TYPE;
    /*lint --fas --fan*/

    typedef enum { CLASS_ONE, CLASS_TWO } DATA_CLASS;

    bool SetOrClear(DATA_TYPE *as, const DATA_CLASS type, const size_t byte, const uint8_t…

    6 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  14. 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 */ …

    6 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    planned  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  15. 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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  16. Be able to suppress for derived classes

    Sometimes it would be nice to suppress a message for all derived classes.

    For example:

    class X
    {
    virtual void f() = 0;
    };

    class Y : public X
    {
    void f() {}
    };

    class Z : public X
    {
    int i;
    void f(){++i;}
    };

    I would like to be able to put the following comment with the declaration of X:
    //lint -esym(1961,[X]::f) //1961 - virtual member function 'Symbol' could be made const

    Where I use [X] as syntax to define X and all classes derived from it.
    So when a sub class dos not use the function f to…

    5 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  17. 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.

    5 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  18. Out Of Bounds Checking at Start Of Array

    This is 'out-of-bounds' is detected:

    unsigned char buffer[5];
    unsigned char* buffer_ptr = &buffer[4];

    ++buffer_ptr; // ERROR! now points to 1 byte after &buffer[4]
    *buffer_ptr = 0x12; // assign to memory outside of buffer[]

    This 'out-of-bounds' is NOT detected:

    unsigned char buffer[5];
    unsigned char* buffer_ptr = &buffer[0];

    --buffer_ptr; // ERROR! now points to 1 byte before &buffer[0]
    *buffer_ptr = 0x12; // assign to memory outside of buffer[]

    As 'buffer_ptr' has been 'bound' to 'buffer' via the assignment I would have expected PC-lint to have detected this.

    4 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    planned  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  19. 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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  20. 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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    planned  ·  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1
  • Don't see your idea?

General

Categories

Feedback and Knowledge Base