this pointer in initializers in OmniIDL
Gary Duzan
gduzan@gte.com
Thu, 11 Dec 1997 14:18:44 -0500
Has anyone else noticed that the OmniIDL code is using this pointers
in partially initialized objects quite a lot? In fact, it is trying to
pass the this pointer, which gets cast to an already-initialized base,
to the constructor for another base. This seems a rather dubious thing
to be doing. It may work in most compilers, but it seems that the
language spec doesn't require it to work, and in particular the SGI
compiler seems to be having trouble with it. Given a strict reading of
the ARM (and the 12/'96 ANSI draft), the this pointer should only be
used in the body of non-static member functions, and the initializer
list isn't in the body of the constructor.
I don't have a particular solution in mind, but it should be
addressed at some point, I think.
Gary Duzan
GTE Laboratories