I suggest you ...

Make wildcards work in -sem statements

Would allow single -sem statement for group of similarly named methods. Example:

//lint -sem(CTest::Pre*Post, pure)

class CTest
int PreOnePost() const;
int PreTwoPost() const;
int PreThreePost() const;

Would cover all 3 methods in CTest.

12 votes
Sign in
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Walter Mallory shared this idea  ·   ·  Admin →


    Sign in
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      • Magnus commented  · 

        We often have an Init function in our classes. So it would be great if
        would work for Init menber functions called in Constructor to get rid of
        "1566 member ’Symbol’ (Location) might have been initialized by a
        separate function but no ’-sem(Name,initializer)’ was seen"

      • Ralf Hain commented  · 

        The heartbeat-security-exploit currently making big waves in the press. My first tip:

        /*lint -function(malloc,OPENSSL_malloc)*/

        Probably also the wildcard-suggestion would not detect the bug, but the heartbeat-issue
        rises the importancy of this feature: Custom memory its done in critical software; the good advice
        form some lint-users comes too often too late.

        The suggestion would enable a line like this:

        /*lint -function(malloc,*malloc) */

        And, additionally to the original suggestion, I 'd suggest this line to be active by default!
        Its simply too riksy to do without.

      • Ralf Hain commented  · 

        // somewhat "speculative checking"
        // to get rid of possible false positive messages:
        -sem(Is*,pure) -sem(is*,pure)
        -sem(has*,pure) -sem(Has*,pure)
        -sem(get*,pure) -sem(Get*,pure)
        // bug-hunter-officers task: strengthen the checking:
        // lint without/with and examine differences;
        // fix bugs/do individual suppressions;
        // then remove the global suppressions.

      • Ralf Hain commented  · 

        This would enable a "SpecialFunctionsWildcards.lnt":

        -function(printf,*printf) // eg debug_printf()
        // ... all other function listed in PC-Lint.pdf,
        // cap 11.1.1. Special Functions


        I've seen often functions like this:


        When the "lint-officer" realizes this, its mostly too late
        in the devlopment-cycle; development is done with lost warnings;
        time has been wasted to fix the bugs the hard way.

        I'd wish there would come more "out of the box".

        Of cause this is speculative and can lead to false results.
        But I'd expect the benefit would exceed the harm.

      Feedback and Knowledge Base