General
26 results found
-
Have restore at end reset the internal counter of -esym
Right now, this works correctly only for -e#, but very often, programmers make mistakes using -esym as well.
Would be nice to not have to debug those using -voif.
Example:@module foo.cpp
namespace test
{
extern bool bar(void);
extern bool flag;bool foo(void)
{
//the next line is a programmer mistake which is carried on into bar.cpp despite using -restoreatend
//lint -esym(1960,5-14-1)
return flag && bar();
}
}@module bar.cpp
namespace test
{
extern bool foo(void);
extern bool flag;bool bar(void)
{
// Violates 5-14-1 but is not reported due to error in previous module
return flag &&…1 voteOptions encountered within source files no longer affect subsequent source files in the upcoming PC-lint Plus which resolves this issue.
-
Error 305: Unable to open module 'Files'
Minor irritation, unclear error message: Using separate directories for exe and lint files creates the following problem unless the path variable is also set to the exe location. Not clear exactly which files lint requires, so have to copy all over (don't want path modified).
c:\"Program Files (x86)\pc-lint 9.0"\lint-nt -v
PC-lint for C/C++ (NT) Vers. 9.00L, Copyright Gimpel Software 1985-2014
Error 305: Unable to open module 'Files'1 voteIt is not clear what the issue here is, please email support for assistance.
-
Extend value tracking for member variables/functions
include <string.h>
//lint -passes(2)
class X
{
int *p;
public:
X(){ p = NULL; }
bool IsValid()const{return p != NULL;}
void Foo()
{
if(IsValid())
*p = 0; // Warning 613: Possible use of null pointer (wrong)
}
void Bar()
{
if(p != NULL)
*p = 0; // no 613 here (ok)
}
};// Value tracking works for global variables (ok)
int pg = NULL;
bool IsValid(const int px)
{
return px != NULL;
}
void Bar()
{
if(IsValid(pg))
*pg = 0;// no 613 here (ok)
}1 voteThis issue has been addressed in the updated value tracking available in the upcoming PC-lint Plus.
-
Add support for MISRA C 2012 addendum 1
automotive industry requirement to comply with additional 16 rules documented in the addendum
1 vote -
Wrong suggestion on how to export environment variables on Linux
This article explains how to create environment variables on Linux. It wrongly suggests:
export INCLUDE=/usr/local/include;/usr/include
but the correct way is as followed (replace ';' by ':' between paths):
export INCLUDE=/usr/local/include:/usr/include
Best regards
Martin Ettl
1 voteThanks for pointing that out Martin, the article has been corrected.
-
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
- Don't see your idea?