|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home Page bug1540.cpp
Running this program under one compiler caused a crash. Under another compiler it seems to run for an excessively long time. Can you spot the problem? (hint: it has to do with memory) bug1540.cpp lint Output
--- Module: bug1540.cpp
_
p = new int[n];
bug1540.cpp 7 Info 1732: new in constructor for class 'A' which has no
assignment operator
bug1540.cpp 7 Info 1733: new in constructor for class 'A' which has no copy
constructor
bug1540.cpp 7 Info 737: Loss of sign in promotion from int to unsigned int
_
~A() { }
bug1540.cpp 9 Warning 1540: Pointer member 'A::p' (line 3) neither freed nor
zero'ed by destructor
Reference Manual Explanation
1540 pointer member 'Symbol' (Location) neither freed nor zero'ed
by destructor -- The indicated member is a non-static pointer
member of a class that was apparently not freed by the class'
destructor. Was this an oversight? By freeing, we mean either
a call to the free() function or use of the delete operator. If
the pointer is only intended to point to static information during
its lifetime then, of course, it never should be freed. In that
case you should signal closure by assigning it the NULL pointer (0).
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #1738 - February 2003