I'm trying to get some code from elsewhere (specifically, here), to compile without any warnings when gcc is given the -pedantic
flag. The only problem is this bit of code:
struct __attribute__ ((aligned(NLMSG_ALIGNTO))) {
struct nlmsghdr nl_hdr;
/* Unnamed struct start. */
struct __attribute__ ((__packed__)) {
struct cn_msg cn_msg;
struct proc_event proc_ev;
};
/* Unnamed struct end. */
} nlcn_msg;
No matter where I try to put in a name for the structure, it results in a compilation error. Is there some way to modify the given code to satisfy -pedantic
? Or is there some way to tell gcc to not issues a warning just for that piece of code?