Re: C ethics question
- From: "Servé Laurijssen" <ser@xxxx>
- Date: Sat, 31 Mar 2007 20:07:49 +0200
"CBFalconer" <cbfalconer@xxxxxxxxx> wrote in message
news:460E5BE5.A78752A6@xxxxxxxxxxxx
"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.
Thanks for clearing that up, funny thing is I thought this was the case
because somebody in this group said this. I thought usenet was always
correct :(
Shame I cant find that post on google
--
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: Richard Heathfield
- Re: C ethics question
- References:
- C ethics question
- From: Servé Laurijssen
- Re: C ethics question
- From: CBFalconer
- C ethics question
- Prev by Date: Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- Next by Date: Re: C ethics question
- Previous by thread: Re: C ethics question
- Next by thread: Re: C ethics question
- Index(es):
Relevant Pages
|