|
![]() Click on image to see enlargment |
|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug522.cpp
Larry, a great inventor, but a novice programmer and golfer, is attempting to automate his scoring with a special device that contains software that will call "ball_is_struck()" each time it hears the ball being struck and "new_hole()" every time a new hole is reached. But something's going wrong. His scores couldn't be that low. bug522.cpp lint Output
--- Module: bug522.cpp (C++)
_
{ *p++; }
bug522.cpp 5 Warning 522: Expected void type, assignment, increment or decrement
bug522.cpp 5 Info 818: Pointer parameter 'p' (line 4) could be declared as pointing to const
Reference Manual Explanation
522 Expected void type, assignment, increment or decrement. -- If a statement consists
only of an expression, it should either be an expression yielding the void type or
be one of the privileged operators: assignment, increment, or decrement. Note that
the statement *p++; draws this message but p++; does not. This message is frequently
given in cases where a function is called through a pointer and the return value is
not void. In this case we recommend a cast to void. If your compiler does not
support the void type then you should use the -fvo option.
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #504 - July 2008