c++ - Warning C4710 (not inlined) with inherited destructors -


i have 3 classes build chain of inheritance. 2 of classes pure abstract (iproxy , idataproxy), third 1 "does work" (dataproxy). classes following (only showing con/destructors here):

iproxy:

class __declspec(dllexport) iproxy { public:     iproxy() {}     virtual ~iproxy() {} }; 

idataproxy:

class __declspec(dllexport) idataproxy : public iproxy { public:     idataproxy() {}     virtual ~idataproxy() {} }; 

dataproxy header:

class __declspec(dllexport) dataproxy : public idataproxy { public:     dataproxy();     virtual ~dataproxy() {} }; 

dataproxy implementation file:

dataproxy::dataproxy() : m_operationtype( eunknown ) {} 

when compile class dataproxy microsoft c++ compiler (version 12.00.8804) following warnings:

warning c4710: function 'virtual __thiscall idataproxy::~idataproxy(void)' not inlined
warning c4710: function 'virtual __thiscall idataproxy::~idataproxy(void)' not inlined
warning c4710: function 'virtual __thiscall dataproxy::~dataproxy(void)' not inlined
warning c4710: function 'virtual __thiscall dataproxy::~dataproxy(void)' not inlined

i don't know these warnings com from. never told compiler inline anything. , don't have idea how rid of these warnings.

can shed light on these warnings? lot!

best regards, oliver

by defining constructors inside class, implicitly add inline specifier. virtual functions (including destructors) not inlined.

however warning comes fact dllexport function must have given (thiscall) calling convention , therefore never inlined. virtual member functions can inlined if called non polymorphically. never case here.

@msalters 's comment provides hint why warning not occur iproxy::~iproxy().

to rid of warning, define empty destructors in source file.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -