Skip to content

Commit

Permalink
test-netlink-conntrack: Fix sparse warning.
Browse files Browse the repository at this point in the history
On some systems I get a sparse warning when compiling
tests/test-netlink-conntrack.c

/usr/include/x86_64-linux-gnu/sys/cdefs.h:307:10: warning: preprocessor
token __always_inline redefined
/usr/include/linux/stddef.h:4:9: this was the original definition

The problem seems to be that Linux upstream commit
283d75737837("uapi/linux/stddef.h: Provide __always_inline to userspace
headers") introduced __always_inline in stddef.h, but glibc headers
didn't like that until e0835a5354ab("Bug 20215: Always undefine
__always_inline before defining it.").

This commit works around the issue by including a glibc header before a
kernel header.

Fixes: 2c06d9a("ovstest: Add test-netlink-conntrack command.")
Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
  • Loading branch information
ddiproietto committed Aug 3, 2016
1 parent 23f974a commit b4409ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test-netlink-conntrack.c
Expand Up @@ -16,6 +16,7 @@

#include <config.h>

#include <stdlib.h>
#include <linux/netfilter/nfnetlink.h>

#include "ct-dpif.h"
Expand Down

0 comments on commit b4409ed

Please sign in to comment.