This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Possible bug in dbg-threads-syscall.c
- From: "Patrick Doyle" <wpd at delcomsys dot com>
- To: "Robin Farine" <acnrf at dial dot eunet dot ch>
- Cc: "eCos" <ecos-discuss at sourceware dot cygnus dot com>
- Date: Wed, 5 Dec 2001 07:38:59 -0500
- Subject: RE: [ECOS] Possible bug in dbg-threads-syscall.c
> > That's what makes sense to me. So then what does:
> >
> > if (*int_fun_ptr == 0) blah()
> >
> > mean?
> > (I know, we are way off topic here, but it does seem like a
> bizarre thing to
> > test).
>
> Frankly, no idea and I don't understand why the compiler eats it
> without any
> sign of sickness.
>
That's _exactly_ what caught me by surprise here. The compiler thinks that
it is a perfectly reasonable construct. Now, I suppose it is possible that
we have just uncovered a subtle flaw in GCC (since I have not looked at this
on any other compilers), but I expect not., I expect that the standard
either defines exactly what is meant by *int_fun_ptr, or states explicitly
that it is implementation defined (more likely). It just seemed bizarre to
me that this would have been accepted by the compiler. I was wondering if
any C language purist gurus out there would step in and say "yep, on page
1234 of the spec, it says that while this is acceptable syntax, the
implementation is free to do whatever it wants", or something like that.
--wpd