I dealt with netlink API and examine its man pages netlink(3) and netlink(7).
Suddenly I faced with such construction:
struct msghdr msg;
msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };
I tried it in C, but it gives the error:
error: expected expression before ‘{’ token
Apparently it's c++ (I don't know what standard).
Of course it's obvious that Netlink is an API and has no particular language binding. But this is C implementation and all MAN pages I've seen about C API have pure C examples. Why there is no note about the language used in examples? What is this practice for and why is this not f.e. on Python or whatever?
UPD: I don't think it's a typo or an unintentional error in MAN page. There are some other places with this C++ feature using, e.g.:
struct iovec iov = { buf, sizeof(buf) };
struct sockaddr_nl sa;
struct msghdr msg;
struct nlmsghdr *nh;
msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };
len = recvmsg(fd, &msg, 0);
for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len);
nh = NLMSG_NEXT (nh, len)) {
...
It looks like a conscious choice of C++.