Re: Cannot understand the following codes
- From: "Alf P. Steinbach" <alfps@xxxxxxxx>
- Date: Wed, 29 Mar 2006 01:27:27 +0200
* Ben C:
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?
It will be OK, /if/ the type is some pointer to function (but not if the type is simply void*, in which case it's UB); I was too hasty there.
Sorry about that... ;-)
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
.
- Follow-Ups:
- Re: Cannot understand the following codes
- From: Ben C
- Re: Cannot understand the following codes
- References:
- Cannot understand the following codes
- From: gpsabove
- Re: Cannot understand the following codes
- From: Alf P. Steinbach
- Re: Cannot understand the following codes
- From: Ben C
- Cannot understand the following codes
- Prev by Date: Re: Lex
- Next by Date: Re: Opinions on a good choice for application re-write
- Previous by thread: Re: Cannot understand the following codes
- Next by thread: Re: Cannot understand the following codes
- Index(es):
Relevant Pages
|