Hi all.
I think there might be a problem with SmartEiffel's code generation for
a particular case of using cecil. In essence the generated C-code is
trying to get a void* to access an 'id' element, as if it was a structure.
In my application I've written a set of signal handlers, all of which are
classes inheriting from a top-level abstract one, ABSTRACT_SIGNAL_HANDLER,
and hence sharing the routine 'callback'. My C glue code accesses this
function and I've defined the cecil file as
eiffel.h
signal_callback ABSTRACT_SIGNAL_HANDLER callback
The generated C-code causing the issue is (I've formatted it a bit):
void
signal_callback(void *C,T8 a1)
{
....
if((((/*no_dispatch.e*/C)->id))!=(INT16_C(246)))
{
error1("Bad target type. The expected type is SIGNAL_HANDLER_SIMPLE.",
0xFFF80007/*l3c0
egl_cecil.se*/);
}
....
}
Am I correct in thinking this is badly generated code? I actually modified
the C code (not shown above) and cast the above C to T0* (probably not the
correct type but I figured since the first element was 'id' it was ok) and
the program ran as expected.
Cheers,
Phil.