[ECOS] Possible bug in dbg-threads-syscall.c

Patrick Doyle wpd@delcomsys.com
Wed Dec 5 04:40:00 GMT 2001


> > 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



More information about the Ecos-discuss mailing list