I wrote one function which is used to count comment and code lines and
it works as it should be, but when compiling I get warning (i686-apple-
darwin9-g++-4.0.1):
pirma.cpp: In function =91int CheckLine(const std::string&, int&)=92:
pirma.cpp:112: warning: control reaches end of non-void function
So, it looks like somehow it still can get to the end of the function,
the problem is that I can not figure out that I could have missed.
This way I added return UNDEFINED at the end of the function, but I
still would like to get the answer what I could have missed.
The whole function has only new local variables and if structure:
int CheckLine(const string &line, int &status) {
string::size_type startPos;
bool emptyStatus =3D true;
if (status =3D=3D CODE || status =3D=3D EMPTY) {
...........
} else {
.........
}
//return UNDEFINED;
}
if there is something I could have missed, it would be in the else
statement, but it looks perfect for me. Any ideas?


|