General

  1. Ability to change message categories

    Support an option that allows the user to change the message category of a message from, for example, Warning to Error.

    4 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Flag idea as inappropriate…  ·  Admin →
  2. allow user-supplied function semantics to override function inputs

    For functions which the user has supplied function-wide semantics, I would like to see a flag/mode that allows the provided semantics to essentially "override" the inputs to the function.

    For example, if I provide a "np" semantic for a function, I don't want to see a message for possible use of NULL pointer generated within the function; I have already provided a semantic that the parameter is not NULL. Similarly with integral parameters, if I provide a semantic that "1n < 2" and then use that parameter to index into a 2 element array, I don't want to…

    4 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. 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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  4. Extra initializer/cleanup semantics

    It would be nice to specify which members are deleted or uinitialzed:

    class X
    {
    int i;
    int
    j;
    float* k;
    void cleanInts() { delete i;delete j;}
    ~X(){delete k;cleanInts();}
    };

    in this case -sem(X::cleanInts,cleanup) won't help.
    I propose the following semantics:
    -sem(X::cleanInts,cleanup(X::i,X::j)) where cleanInts should free X::i and X::j

    3 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 →
  5. 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 &lt; 10; ++loop)
    {
    array[index] = loop;
    ++index;

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

    }

    2 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 →
  6. Ignore -d command line option if empty (-d"")

    We are using CMake build system to generate the command-line options and run PC-Lint. The command line options are generated after the configuration stage of CMake and it can happen that the value of a define is not known yet at that stage:

    $<$<BOOL:OFF>:BUILD_TESTS>

    If BUILD_TESTS is disabled, the command line option will be empty:

    -d"$<$<BOOL:OFF>:BUILD_TESTS>" gets converted to:
    -d""

    When you run pclp64 -d"" the following error appears:

    --- Module: /projects/alpha/alpha.c (C)
    <command line option> 1 error 5469: macro name must be an identifier

    #define 1

    My request is to check if -d argument is empty, and if it's…

    1 vote
    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. 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
    'eGetInternal_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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  8. 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(&quot;a = 0&quot;);
    

    }
    }

    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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  9. to add a new warning to find use of an explicite cast from real to unsigned int.

    Although an explicite cast looks like the programmer knew, the intended behaviour may need two casts.
    I wanted to "infinitely" accumulate possibly small, possibly negative increments (float i) in a modulo counter consisting of an unsigned integer variable (uint32_t n) and a real variable (float f) for the fractional part.

    f += i;
    n += (uint32t)f; // should read n += (uint32t)(int32t)f;
    f -= (int32
    t)f;

    worked with several compilers for PC platforms (gcc, lcc32, VS C++) and with TI''s c6000 compiler for an OMAP L138, but the counter failed to decrease with TI's ARM5.1 compiler for…

    1 vote
    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 →
  10. 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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  11. Variable could be declared as const ref

    Similar to message: 953 - Variable 'Symbol' (Location) could be declared as const

    I would like to see a message for the following situation:

    struct X
    {
    int i;
    };

    struct Y
    {
    const X& f();
    };

    int g( Y y)
    {
    const X x = y.f();
    return x.i + 5;
    }

    In this case variable x could be declared as const ref.
    When the intialization of a const variable is done with an other const variable or a function returning a const reference this message (or maybe two separete messages) could be issued

    1 vote
    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. Relax warning 747 for literals

    Given this code:

    include <stdio.h>

    include <string>

    void test()
    {

    std::string mystr(&quot;Hello World&quot;);
    
    char c;

    c = mystr[1];
    printf(&quot;char: %c&quot;, (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
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
2 Next →
  • Don't see your idea?

General

Categories

Feedback and Knowledge Base