Re: C ethics question
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Sat, 31 Mar 2007 08:02:29 -0500
"Servé Laurijssen" wrote:
.... snip ...
static void OnChangemeter(struct METER *m)
{
if (m == &m1) ...
if (m == &m2) ...
}
Now the comparison of these pointers is UB in C but in this case
it's the only way to do it. What would you do in such a situation
when you work on a project that has to be finished shortly?
No, it's not UB. Those are equality tests, not relative tests.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: C ethics question
- From: Servé Laurijssen
- Re: C ethics question
- References:
- C ethics question
- From: Servé Laurijssen
- C ethics question
- Prev by Date: Re: About Union's question
- Next by Date: Re: A question about sort stable
- Previous by thread: Re: C ethics question
- Next by thread: Re: C ethics question
- Index(es):