The use of DELETEP with a cast inside it is causing problems in the 
compilation of ev_Menu_Actions.cpp, line 138 ev_Menu_Labels.cpp, line 
97 and ev_MenuLayouts.cpp, line 96.

Specifically, lines like:

DELETEP(static_cast<EV_Menu_Action *> (tmp));

are throwing up this compilation error:

ANSI C++ forbids cast to non-reference type used as lvalue.

I beleive it's bacause DELETEP is expanding these lines to something 
like:


delete (static_cast<EV_Menu_Action *> (tmp));
static_cast<EV_Menu_Action *> (tmp) = 0;  // This is not legal C++.

The solution is to change these lines to either:

EV_Menu_Action tmp2 = static_cast<EV_Menu_Action *> (tmp);
// We need tmp2 becausing passing a cast into DELETEP causes invalid C+
+ code
// to be generated.
DELETEP(tmp2);

or simply:
DELETEP(tmp); // I think this is legal and non-leaky.

I haven't posted a patch. because I couldn't decide which solution was 
the most 'correct' or understandable.

Jamie.


Reply via email to