recursive on all control paths, function will cause runtime stack overflow
I have converted VC6 project to .Net 2005 VC++.
It gives me warning :
warning C4717: 'CExcel::PrintLine' : recursive on all control paths, function will cause runtime stack overflow
void CExcel::PrintLine( LPCSTR pchText )
{
PrintLine( _bstr_t( pchText ) );
}
void CExcel::Print( LPCSTR pchText )
{
Print( _bstr_t( pchText ) );
}
Above functions are working fine VC 6.0.
Can any one please help me fix / resolve this issue?
Due to this warning, application is not working on .net 2005 VC++.
Why is CExcel::PrintLine calling itself? Did you mean to call a global function? Or another function of the same class but with a different prototype? What is that other function's prototype?
You keep calling the function in which you are, it's an infinite loop, which will cause a stack overflow.
We've had this warning malfunction in SlimDX as well. I'm going to assume the OP has two other functions with the same name that take a BSTR as an argument, in which case his complaint would be valid. If that's the case, you can use #pragma to disable the warning in that one particular location.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement