General
24 results found
-
Having multiple initializer functions in a constructor
Lint checks, if all of the members are initialized in the constructor. Optionally this check could be redirected to an initializer-function introduced with the -sem Command. But then the initialization has to be done completely in the initializer-function.
In our embedded software it is quite common to have more than one function doing the initialization task, e.g.:
class A
{
public:
A()
{
membera = 0;
initFunction1();
initFunction2();
}
private:
void initFunction1()
{
memberb = 0;
}void initFunction2() { member_c = 0; } int member_a; int member_b; int member_c;
};
It would be very helpful, that lint…
19 votesIn the upcoming PC-lint Plus, full or partial initializations that takes place in functions called by a constructor are automatically recognized without the need for an initializer semantic. In the example provided, no message would be issued. The initializer semantic can still be used if the definition of an initializing member function is not available but otherwise isn’t necessary.
-
-efile2 for inhibition within a file
-efile only inhibits messages about a file. This causes requests in the forum/to support from time to time. Mostly the questioner will be explained that -efile works only for messages about the file. The answer is correct, but leaves the questioner unsatisfied, as he/she is looking for something like -efile2.
It should not be too difficult to implement it and would help many people.
23 votesThe -efile option has been extended to support suppressions within a file instead of just suppressions about a file in the upcoming PC-lint Plus.
-
Please add an _optional_ (not on by default) warning to find use of catch (...)
I'd like you to consider adding a optional warning for the "catch all uncaught exceptions" clause, catch with a 3 dot ellipsis:
catch (...)
This can be a dangerous construct certainly on some of the Microsoft compilers with interactions with Structured Exception Handling, and is warned against by a number of key figures, including John Robbins.
1 voteThis suggestion has been implemented in the upcoming PC-lint Plus as two new messages:
1766 – catch(…) encountered without preceding catch clause
1966 – catch(…) encountered after catch clause
-
9xxx messages for MISRA C++
PC-lint 9.00k introduced support for MISRA C 2012 via a set of 9000-series messages which is a significant improvement over previous versions which lumped the messages together under a couple of messages. This is a request to extend the 9000 messages to cover MISRA C++.
11 votesThis feature has been implemented for version 9.00L. A beta for 9.00L, along with an alternative MISRA C++ lnt file (au-mirsra-cpp-alt.lnt), are available at http://gimpel.com/html/90beta/.
- Don't see your idea?