Extract from devSoft.cc (in motor/motorApp/SoftMotorSrc/)
void soft_motor_callback(CALLBACK *cbptr)
{
#ifdef __GNUG__
struct motorRecord *mr;
callbackGetUser((void *) mr, cbptr);
soft_process(mr);
#else
void *mr;
callbackGetUser(mr, cbptr);
soft_process((motorRecord *) mr);
#endif
}
Compiling this on g++ 3.4.3 results in:
../devSoft.cc: In function `void soft_motor_callback(CALLBACK*)':
../devSoft.cc:297: error: ISO C++ forbids cast to non-reference type
used as lvalue
But removing the whole chunk inside the #ifdef does compile, on g++
3.4.3
Either chunk compiles on g++ 3.2.2
Does anyone know which versions of the GNU C++ compiler actually
required the first stanza? Can it be removed completely, since all
newish g++ versions work with the second stanza?
Peter Denison, Senior Software Engineer
Diamond Light Source Ltd., Diamond House, Chilton, Didcot, Oxon, OX11
0DE
Tel: +44 1235 778511