Re: C ethics question
- From: "Harald van Dijk" <truedfx@xxxxxxxxx>
- Date: 31 Mar 2007 04:23:42 -0700
Servé Laurijssen wrote:
Recently, I found myself in the following situation:
There is library software written in C which declares some externals like:
struct METER m1;
struct METER m2;
in different sourcefiles and I have no control over these sources.
Then there's functions that operate on these meters and will generate an
event which passes a METER * to identify which meter has been changed.
static void OnChangemeter(struct METER *m)
{
if (m == &m1) ...
if (m == &m2) ...
}
Now the comparison of these pointers is UB in C [...]
No, it isn't.
.
- 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: C ethics question
- Next by Date: Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- Previous by thread: C ethics question
- Next by thread: Re: C ethics question
- Index(es):
Relevant Pages
|