Cuberite Forum
MSVC Code Analysis failure - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Off Topic (https://forum.cuberite.org/forum-9.html)
+--- Forum: Off Topic Discussion (https://forum.cuberite.org/forum-10.html)
+--- Thread: MSVC Code Analysis failure (/thread-1866.html)



MSVC Code Analysis failure - xoft - 04-05-2015

I tried MSVC's Code Analysis, but it fails to compile the server:
src\BlockInfo.h(34): error C2248: 'cBlockInfo::~cBlockInfo' : cannot access protected member declared in class 'cBlockInfo'

The relevant source:
static cBlockInfo & Get(BLOCKTYPE a_Type)
{
	static cBlockInfo ms_Info[256];
	static bool IsBlockInfoInitialized = false;
	if (!IsBlockInfoInitialized)
	{
		cBlockInfo::Initialize(ms_Info);
		IsBlockInfoInitialized = true;
	}
	return ms_Info[a_Type];
}  // Error reported here
Anyone got an idea why? The code compiles fine when Code Analysis is turned off again.


RE: MSVC Code Analysis failure - LO1ZB - 04-05-2015

The problem is, as the error says, "cBlockInfo" is protected.
I told you, that that's a problem for the Code Analysis tool from the MCVS a while ago. :/
It works without a problem, when you make it public.
(remove "protected:" at line 89)