[omniORB] Port of omniORB_280pre1 to Compaq C++ 6.2 OpenVMS Alpha 7.1

Stephen Coy stevec@cia.com.au
Wed, 07 Jul 1999 13:27:02 +1000


Bruce Visscher <visschb@rjrt.com> said:

> 
> I have just completed building omniORB_280pre1 with Compaq C++ 6.2
> (formerly DEC C++) on OpenVMS Alpha 7.1.
>
> When I tried to compile src/lib/omniORB2/dynamic/bootstrapDynSK.cc, I
> got:
>
>   _0RL_buildDesc_cstring(_newdesc,
> (*((_CORBA_Unbounded_Sequence__String*)_desc-
>>opq_seq))[_index]);
> ...................................^
> %CXX-W-REFTEMPORARY, initial value of reference to non-const must be an
>           lvalue
> at line number 36 in file
> OMNIROOT:[OMNIORB_280PRE1.SRC.LIB.OMNIORB2.DYNAMIC]BOOTSTRAPDYNSK.CC;1
>
> I believe the compiler is correct, so I've included a patch.
>

For what its worth, I have encountered a similar problem while building this
code using the Metrowerks compiler (on a Macintosh). I think the compiler is
correct too.

For a while I was not sure that that this was the right fix though.

The operator[] is returning an object that is effectively a temporary.
_0RL_buildDesc_cstring seems to be stashing the address of a member of this
temporary. However, it appears to be OK because the member itself is
actually a reference and we finish up with the address of the original data.

Regards,

Steve Coy
Resolve Software
(sighing in relief for having checked thru the above fully before saying it
was all wrong!)