From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQbLC-0006B0-7m for qemu-devel@nongnu.org; Tue, 02 Feb 2016 08:49:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQbL7-0008Hy-Pf for qemu-devel@nongnu.org; Tue, 02 Feb 2016 08:49:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQbL7-0008Hm-KB for qemu-devel@nongnu.org; Tue, 02 Feb 2016 08:49:53 -0500 From: Markus Armbruster References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-25-git-send-email-eblake@redhat.com> Date: Tue, 02 Feb 2016 14:49:49 +0100 In-Reply-To: (James Hogan's message of "Tue, 2 Feb 2016 12:25:55 +0000") Message-ID: <87bn7zjk76.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v12 24/36] cpu: Convert CpuInfo into flat union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: James Hogan Cc: Paolo Bonzini , qemu-devel@nongnu.org, Luiz Capitulino James Hogan writes: > Hi Eric, > > On 18 November 2015 at 08:52, Eric Blake wrote: >> +# An enumeration of cpu types that enable additional information during >> +# @query-cpus. >> +# >> +# Since: 2.6 >> +## >> +{ 'enum': 'CpuInfoArch', >> + 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] } >> + > > ... > >> +## >> +# @CpuInfo: >> +# >> +# Information about a virtual CPU >> +# >> +# Since: 0.14.0 >> +## >> +{ 'union': 'CpuInfo', 'base': 'CpuInfoBase', 'discriminator': 'arch', >> + 'data': { 'x86': 'CpuInfoX86', >> + 'sparc': 'CpuInfoSparc', >> + 'ppc': 'CpuInfoPpc', >> + 'mips': 'CpuInfoMips', > > This is causing compilation issues on MIPS, because gcc bizarrely > defines mips=3D1: > > $ mips-img-linux-gnu-gcc -dM -E - #define mips 1 Bizarre indeed. See also https://gcc.gnu.org/onlinedocs/gcc-5.3.0/cpp/System-specific-Predefined-Mac= ros.html#System-specific-Predefined-Macros > For example: > CC qga/commands.o > In file included from /work/mips/qemu/msa/include/qapi/qmp/qobject.h:37:0, > from /work/mips/qemu/msa/include/qapi/qmp/dispatch.h:17, > from ./qga/guest-agent-core.h:13, > from qga/commands.c:14: > ./qapi-types.h:2568:22: error: expected identifier or =E2=80=98(=E2=80=99= before > numeric constant > CpuInfoMIPS *mips; > ^ > /work/mips/qemu/msa/rules.mak:57: recipe for target 'qga/commands.o' fail= ed > make: *** [qga/commands.o] Error 1 > > > Any suggestions for a fix that is less ugly than this: #undef mips with a suitable comment? [...]