|
![]() Click on image to see enlargment |
|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug669.cpp
For Jack and Jill's wedding, Jill wanted a wedding bouquet of 20 asterisks (she's a programmer). But Jack's program has a slight flaw. Can you spot it? bug669.cpp lint Output
--- Module: bug669.cpp (C++)
_
Wedding() { bouq = new char[LEN+1]; }
bug669.cpp(8) : Info 1732: new in constructor for class 'Wedding' which has no
assignment operator
bug669.cpp(8) : Info 1733: new in constructor for class 'Wedding' which has no
copy constructor
_
void init() { memset( bouq, LEN, '*' );
bug669.cpp(9) : Warning 669: Possible data overrun for function 'memset(void *,
int, unsigned int)', argument 3 (size=42) exceeds argument 1 (size=21)
[Reference: file bug669.cpp: lines 8, 9]
Reference Manual Explanation
669 Possible data overrun for function 'Symbol', argument Integer exceeds
argument Integer Reference -- This message is for data transfer functions
such as memcpy, strcpy, fgets, etc. when the size indicated by the first
cited argument (or arguments) can possibly exceed the size of the buffer area
cited by the second. The message may also be issued for user functions via the
-function option See Function Mimicry and Value Tracking.
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #1538 - May 2007