>> At a guess, sizeof(XmGadget) < sizeof(Widget) so casting a gadget to Widget
  >> will trigger a bounds check?

  Alexander> What's the purpose on checking bounds on read not write access?

You mean why check reads at all?  I can imagine all kind of damage to an
algorithm that can result from reading beyond the end of an object.  Also,
having detected a bounds violation somewhere, you need to know where it
originated, so the cast is an obvious source of such problems.


  Alexander> And finally: do we need to keep this code??
  Alexander> I don't consider it good style to have code depending on some "strange"
  Alexander> compiler features in public headers.

Since it predates 1997/02/20, there is a good chance that the compiler has
changed since it was written anyway!

The way that Widget and XmGadget conveniently overlap reminds me of FORTRAN
common blocks :-)

__Martin

Reply via email to