[omniORB] omniEvents 2.6.1 install error on irix6

Alex Tingle alex.tingle at bronermetals.com
Thu Apr 21 13:07:41 BST 2005


On 21 Apr 2005, at 10:06, caoy wrote:
> Hi, thank you Alex Tingle, I had fixed a few errors by add -LANG:std 
> in config.mk and defined HAVE_STD_IOSTREAM in config.h.
>
> Now there is only one error in EventChannel.cc ,line 156:
> output(WriteLock().os);
> The CC compiler said that the initial value of a reference to a 
> non-const must be on lvalue, WriteLock().os.
>
> WriteLock is defined as a class in omniEventsLog.h ,right? I just 
> don't understand what's means about WriteLock().
>
> Any suggestion?

Are you using an old compiler? That line should work, but it is being a 
bit clever-clever. WriteLock() constructs a temporary object of type 
WriteLock. It survives while the output() method is executing, and it 
is then destroyed.

Here's an alternative that doesn't rely on a temporary:

{
   WriteLock wl;
   output(wl.os);
}

Why use one line, when four will do, eh?

Please let me know what version of SGI's CC compiler you are using.

-Alex Tingle

--
Dammit Jim, I'm a programmer... not a mind reader!




More information about the omniORB-list mailing list