|
![]() Click on image to see enlargment |
|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug1539.cpp
Our programmer felt that the assignment of the Ruth batting statistics to Foxx would have meant that their averages should be the same and was astounded to find a substantial difference. Where did he go wrong? bug1539.cpp lint Output
--- Module: bug1539.cpp (C++)
_
}
bug1539.cpp(10) : Warning 1539: member 'Batter::hits' (line 4) not assigned by assignment operator
bug1539.cpp(4) : Info 830: Location cited in prior message
_
double ave() { return (double) hits / at_bats; }
bug1539.cpp(11) : Info 1762: Member function 'Batter::ave(void)' could be made const
Reference Manual Explanation
1539 member 'Symbol' (Location) not assigned by assignment operator
-- The indicated Symbol was not assigned by an assignment
operator. Was this an oversight? It is not strictly necessary
to initialize all members in an assignment operator because the
'this' class is presumably already initialized. But it is easy
to overlook the assignment of individual members. It is also
easy to overlook your responsibility to assign base class
members. This is not done for you automatically. [12, Item 16]
The message is not given for const members or reference members.
If you have a member that is deliberately not initialized you may
suppress the message for that member only using -esym.
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #419 - April 2006