writing code for IPC servers

Ronald Aigner ra3 at os.inf.tu-dresden.de
Thu Mar 31 17:10:22 CEST 2005

sorry for the delay.

Tiago Jorge said:
> When i come to build the stubs it with g++, it gives me error in the
> lines that fill the exception in the call, more precisely here:
> l4_umword_t _exception = ((dice_CORBA_exception_type){ _s: { .major =
> _dice_corba_env->major, .repos_id = _dice_corba_env->repos_id }})._raw;
> it says:
> /home/tiago/l4/pkg/ipc_example/server/src/hiworld-server.cc:17: error:
> parse
>    error before `.' token
> how can i adapt this line to C++ or... where is the "error".
I tried to find a solution to this. It seems that the above initializer is
only valid in C. In C++ a struct is treated as a class and has therefore
to be initialized like a class (that's what I am guessing).
A temporary workaround would be to replace the above line with an explicit
assignment of the structs members:

dice_CORBA_exception_type _exc_tmp;
_exc_tmp._s.major = _dice_corba_env->major;
_exc_tmp._s.repos_id = _dice_corba_env->repos_id;
l4_umword_t _exception = _exc_tmp._raw;

Sorry, but currently that's the only solution I can come up with. Maybe a
C++ guru can jump in?

Greetings, Ron.

Ronald Aigner
ra3 at os.inf.tu-dresden.de

More information about the l4-hackers mailing list