|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug437.cpp
Whether this was the work of the Grinch or not we'll never know. But the program above has a serious flaw. Fortunately Santa was using PC-lint and the error was caught just in time. bug437.cpp lint Output
--- Module: bug437.cpp
_
};
bug437.cpp(10) : Info 1712: default constructor not defined for class
'BagOfToys'
_
printf( "This bag goes to %s\n", johnny );
bug437.cpp(15) : Warning 437: Passing struct 'BagOfToys' to ellipsis
bug437.cpp(15) : Warning 560: argument no. 2 should be a pointer
--- Global Wrap-up
Info 1714: Member function 'BagOfToys::operator const char *(void) const' (line
8, file bug437.cpp) not referenced
Reference Manual Explanation
437 Passing struct 'Symbol' to ellipsis -- A struct is being passed to a
function at a parameter position identified by an ellipsis. For example:
void g()
{
struct A { int a; } x;
void f( int, ... );
f( 1, x );
...
}
This is sufficiently unusual that it is worth pointing out on the likelihood
that this is unintended. The situation becomes more severe in the case of a
Non-POD struct [10]. In this case the behavior is considered undefined.
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #1557 - November 2003