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

    (n-times) x [

    <SW-part specific

    3 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 →
  4. 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 →
  5. 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 →
  6. Add output of the received and expected types for messages that indicate type differences

    With the MISRA 2012 "essential type" implementation, we often see messages that indicated "Expression assigned to a narrower or different essential type" or "Composite expression with smaller essential type than other operand". For these types of messages that indicate a discrepancy of type, it would help in debugging these messages if the types involved could be added into the output.

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

    3 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 →
  8. 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 →
  9. 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.

    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 →
  10. 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 →
  11. 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…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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 →
  13. 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 →
  14. 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