Re: Cannot understand the following codes



On 2006-03-28, Alf P. Steinbach <alfps@xxxxxxxx> wrote:
[...]

(*(void (*)
(int,t_go_measurements[]))(stGOFuncs.p_go_Measurements))(i_,ast_);

[...]

What is possibly the type of stGOFuncs.p_go_Measurements? I did not see
its definition.

It's probably a void(*)(). But not matter what type it has, the cast is
undefined behavior in C++, and I believe also in C.

Why's it undefined behaviour? I can see that it invites undefined
behaviour, but not that it entails it-- if the value of
stGOFuncs.p_go_Measurements is a function of the correct type won't it
be OK?
.