Received: from eggs.gnu.org ([2001:4830:134:3::10]:36630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLg1r-0000WB-Iy for qemu-devel@nongnu.org; Tue, 19 Jan 2016 18:49:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLg1n-0002vB-IN for qemu-devel@nongnu.org; Tue, 19 Jan 2016 18:49:39 -0500 Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]:38140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLg1n-0002ux-B9 for qemu-devel@nongnu.org; Tue, 19 Jan 2016 18:49:35 -0500 Received: by mail-ig0-x22a.google.com with SMTP id mw1so1643328igb.1 for ; Tue, 19 Jan 2016 15:49:33 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) From: Programmingkid In-Reply-To: <1457E61C-5578-4825-9524-B695E96FDDB8@gmail.com> Date: Tue, 19 Jan 2016 18:49:30 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <5525054B-A7E2-4538-9F68-9E606B85B1B7@gmail.com> <569C224B.2040102@redhat.com> <1866CB23-7966-4F68-8925-2C3888753883@gmail.com> <569D24D2.3000800@redhat.com> <82CB3A8D-1061-48FF-9236-C09A54B5DC68@gmail.com> <279CE146-AEEB-49A9-BB39-C5A0C900784C@gmail.com> <1457E61C-5578-4825-9524-B695E96FDDB8@gmail.com> Subject: Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Eric Blake , Paolo Bonzini , qemu-devel qemu-devel On Jan 18, 2016, at 8:23 PM, Programmingkid wrote: >=20 > On Jan 18, 2016, at 5:09 PM, Peter Maydell wrote: >=20 >> On 18 January 2016 at 21:09, Programmingkid = wrote: >>>=20 >>> On Jan 18, 2016, at 3:49 PM, Peter Maydell wrote: >>>> Can you say what 'gcc --version' prints for you? That will >>>> tell us the clang version number, which is more interesting >>>> than what clang claims its gcc-compatibility is. >>>=20 >>> $ gcc-4.9 --version >>> gcc-4.9 (Homebrew gcc49 4.9.2_1) 4.9.2 >>> Copyright (C) 2014 Free Software Foundation, Inc. >>> This is free software; see the source for copying conditions. There = is NO >>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR = PURPOSE. >>=20 >> Ah, I misread your earlier message and I thought you said that >> gcc-4.9 worked ok and it was plain 'gcc' that caused the warning. >> Is that expansion of the macro the one produced by gcc-4.9, then? >=20 > Actually it should have but wasn't. It is of gcc 4.2.1. >=20 > Here is gcc 4.9.2's output: >=20 > char control[(((__darwin_size_t)((char = *)(__darwin_size_t)(sizeof(struct cmsghdr)) + (sizeof(__uint32_t) - 1)) = &~ (sizeof(__uint32_t) - 1)) + ((__darwin_size_t)((char = *)(__darwin_size_t)(sizeof(int) * 16) + (sizeof(__uint32_t) - 1)) &~ = (sizeof(__uint32_t) - 1)))] =3D { 0 }; >=20 > This is gcc 4.2.1's output: >=20 > char control[(((__darwin_size_t)((char = *)(__darwin_size_t)(sizeof(struct cmsghdr)) + (sizeof(__uint32_t) - 1)) = &~ (sizeof(__uint32_t) - 1)) + ((__darwin_size_t)((char = *)(__darwin_size_t)(sizeof(int) * 16) + (sizeof(__uint32_t) - 1)) &~ = (sizeof(__uint32_t) - 1)))] =3D { 0 }; >=20 > They appear to be identical.=20 >=20 >>=20 >> Also, you're right that we should figure out why it seems to >> be using the wrong C compiler. Can you use 'V=3D1' to look at >> what command line make is using to compile this file, please? >> (you'll probably want to dump the whole make output to a file >> and then search through it). >=20 > It says gcc-4.9 for the compiler. I wonder if the wrong header file is = being used somewhere.=20 >=20 >> Also: >> * what does your config-host.mak say (in particular about what >> it's set CC, HOST_CC, CXX, etc to)? >=20 > CC=3Dgcc-4.9 > HOST_CC=3Dcc > CXX=3Dgcc-4.9 > CPP=3Dgcc-4.9 -E > OBJCC=3Dgcc-4.9 >=20 >> * can you check your environment doesn't have CC set to anything? >> ("env | grep CC" should tell you if it is) >=20 > Nothing is returned. printf("GCC version =3D %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, = __GNUC_PATCHLEVEL__); I thought I should add that with this code in the = qio_channel_socket_register_types() function of channel-socket.c, this = was printed: GCC version =3D 4.9.2 It looks like my theory of another version of GCC being used for = compiling the channel-socket.c file isn't correct.=20=