General
4 results found
-
Enable opt-in assumptions about the initial values of static variables
This condition doesn't seem to be detected by PC-lint Plus:
include <stdint.h>
include <string.h>
typedef struct
{
uint8t one;
uint8t two;
uint8t three[18];
} testt;static testt *mpdef;
static testt *mpabc;void
test (void)
{
// These manipulations should trigger a warning since both pointers are not initialized.
mpdef->one = 1;
mpabc->one = 2;
}1 vote -
Find message inhibitions inside files that have no effect
Sometimes the following happens:
Code is created with a deliberate violation of a lint message.
The message in inhibited with a comment in the code.
However, it often happens comments are not updated with code.
So the reason for the inhibition may be removed and the inhibition stays.It would be nice to find such "broken" inhibitions, (that have no effect on the resulting messages even when all other inhibitions are disabled).
Maybe this search can be a result of executing pc-lint with a special flag.This way the code can be cleaned of old inhibitions.
46 votes -
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 -= (int32t)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 -
Be able to suppress for derived classes
Sometimes it would be nice to suppress a message for all derived classes.
For example:
class X
{
virtual void f() = 0;
};class Y : public X
{
void f() {}
};class Z : public X
{
int i;
void f(){++i;}
};I would like to be able to put the following comment with the declaration of X:
//lint -esym(1961,[X]::f) //1961 - virtual member function 'Symbol' could be made constWhere I use [X] as syntax to define X and all classes derived from it.
So when a sub class dos not use the function f to…5 votes
- Don't see your idea?