On May 17, 2006, at 8:03 PM, Roman Kononov wrote:
extern "C" {
static inline int foo(int socket) {
struct empty_t {};
struct network_message_t {
empty_t foo;
int stuff;
} msg;
msg.stuff=0;
return send(socket,&msg,sizeof(msg));
}
}
We would like foo() to send same message from C++ and C code.
That is just bogus. Why have an empty struct in there in the first place.
The only place empty structs come handy is where they don't store data
and are needed to pass around as pointers like a lock (though I don't
think that is a good use anyways).