M
Michael Kennedy [UB]
Hi,
I am back with more bug reports from Visual Studio.NET 2003's C++ compiler
(unmanaged). Consider the following method:
---------------------------------------------
__forceinline
bool CReplayBase::ReplayFillBuffer()
{
CFile* pFile = NULL;
for(int i=0; i<m_FileList.GetCount(); i++)
{
pFile = m_FileList.GetAt ;
}
}
---------------------------------------------
It is has bool return type, but no path returns any values. Obviously this
is an error and should not compile. Yet it does!
Now comment out the __forceinline and it stops compiling and reports the
error of "not all control paths return a value."
Any thoughts? We can certainly live with this bug, but it'd be better if it
was fixed.
Thanks in advance,
Michael
I am back with more bug reports from Visual Studio.NET 2003's C++ compiler
(unmanaged). Consider the following method:
---------------------------------------------
__forceinline
bool CReplayBase::ReplayFillBuffer()
{
CFile* pFile = NULL;
for(int i=0; i<m_FileList.GetCount(); i++)
{
pFile = m_FileList.GetAt ;
}
}
---------------------------------------------
It is has bool return type, but no path returns any values. Obviously this
is an error and should not compile. Yet it does!
Now comment out the __forceinline and it stops compiling and reports the
error of "not all control paths return a value."
Any thoughts? We can certainly live with this bug, but it'd be better if it
was fixed.
Thanks in advance,
Michael