From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZbem-0005d5-Tr for qemu-devel@nongnu.org; Tue, 16 Aug 2016 06:31:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZbeh-0007gn-Uf for qemu-devel@nongnu.org; Tue, 16 Aug 2016 06:31:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZbeh-0007ge-Oo for qemu-devel@nongnu.org; Tue, 16 Aug 2016 06:31:35 -0400 References: <23806aac6db3baf7e2cdab4c62d6e3468ce6b4dc.1471340849.git.mprivozn@redhat.com> From: Michal Privoznik Message-ID: <6169abd0-4b13-081d-4b99-d3449c495535@redhat.com> Date: Tue, 16 Aug 2016 12:31:32 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] syscall.c: Fix build with older linux-headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On 16.08.2016 12:04, Peter Maydell wrote: > On 16 August 2016 at 10:47, Michal Privoznik wrote: >> In c5dff280 we tried to make us understand netlink messages more. >> So we've added a code that does some translation. However, the >> code assumed linux-headers to be at least version 4.4 of it >> because most of the symbols there (if not all of them) were added >> in just that release. This, however, breaks build on systems with >> older versions of the package. >> >> Signed-off-by: Michal Privoznik >> --- >> linux-user/syscall.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 86 insertions(+) > > >> u32 = NLA_DATA(nlattr); >> *u32 = tswap32(*u32); >> break; >> /* uint64_t */ >> +#ifdef IFLA_BR_HELLO_TIMER >> case IFLA_BR_HELLO_TIMER: >> +#endif >> +#ifdef IFLA_BR_TCN_TIMER >> case IFLA_BR_TCN_TIMER: >> +#endif >> +#ifdef IFLA_BR_GC_TIMER >> case IFLA_BR_GC_TIMER: >> +#endif >> +#ifdef IFLA_BR_TOPOLOGY_CHANGE_TIMER >> case IFLA_BR_TOPOLOGY_CHANGE_TIMER: >> +#endif >> +#ifdef IFLA_BR_MCAST_LAST_MEMBER_INTVL >> case IFLA_BR_MCAST_LAST_MEMBER_INTVL: >> +#endif >> +#ifdef IFLA_BR_MCAST_MEMBERSHIP_INTVL >> case IFLA_BR_MCAST_MEMBERSHIP_INTVL: >> +#endif >> +#ifdef IFLA_BR_MCAST_QUERIER_INTVL >> case IFLA_BR_MCAST_QUERIER_INTVL: >> +#endif >> +#ifdef IFLA_BR_MCAST_QUERY_INTVL >> case IFLA_BR_MCAST_QUERY_INTVL: >> +#endif >> +#ifdef IFLA_BR_MCAST_QUERY_RESPONSE_INTVL >> case IFLA_BR_MCAST_QUERY_RESPONSE_INTVL: >> +#endif >> +#ifdef IFLA_BR_MCAST_STARTUP_QUERY_INTVL >> case IFLA_BR_MCAST_STARTUP_QUERY_INTVL: >> +#endif >> u64 = NLA_DATA(nlattr); >> *u64 = tswap64(*u64); >> break; >> /* ifla_bridge_id: uin8_t[] */ >> +#ifdef IFLA_BR_ROOT_ID >> case IFLA_BR_ROOT_ID: >> +#endif >> +#ifdef IFLA_BR_BRIDGE_ID >> case IFLA_BR_BRIDGE_ID: >> +#endif >> break; > > Aren't there complaints about unreachable code if the > defines are all undefined ? Yeah, I was worried about that too, but no. My compiler must be wise enough to realize what is going on. I see no error, nor warning. Michal