From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN4Cq-0002Yw-FT for qemu-devel@nongnu.org; Tue, 12 Jul 2016 16:23:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bN4Cp-0000s6-9P for qemu-devel@nongnu.org; Tue, 12 Jul 2016 16:23:00 -0400 References: <1468336912-20396-1-git-send-email-eblake@redhat.com> <578535BC.3000904@redhat.com> From: Eric Blake Message-ID: <5785519B.8080504@redhat.com> Date: Tue, 12 Jul 2016 14:22:51 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GL2A78wNaNkJCT1BJalElOtPDX11dMWqO" Subject: Re: [Qemu-devel] [PATCH] build: Work around SIZE_MAX bug in OSX headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Kevin Wolf , Qemu-block This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GL2A78wNaNkJCT1BJalElOtPDX11dMWqO From: Eric Blake To: Peter Maydell Cc: QEMU Developers , Kevin Wolf , Qemu-block Message-ID: <5785519B.8080504@redhat.com> Subject: Re: [Qemu-devel] [PATCH] build: Work around SIZE_MAX bug in OSX headers References: <1468336912-20396-1-git-send-email-eblake@redhat.com> <578535BC.3000904@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/12/2016 01:35 PM, Peter Maydell wrote: > I tested this patch with a compile on OSX, and it does compile > without warnings or errors. (NB: haven't tested that it > fixes the warning that was being complained about in the > other patchset.) Ultimately, the combination of this patch plus the block patchset in question is where we prove if it makes a positive difference, so if you do have a chance to test it on OSX, that would be nice. And that's true whether we keep this version of the patch (with #if __APPLE__) or do a second version based on a witness set at configure time, because the interaction you're testing is if the replacement #define SIZE_MAX silences the warning about printf(%zd). >=20 > I don't have a very strong opinion about whether it's the > best fix, but a couple of thoughts: > * my inclination is to prefer not to override system > headers except where we've checked and know they're broken > (ie in a future world where Apple get their headers right > I'd rather we automatically ended up using their version > rather than ours) Indeed, a configure-based solution would avoid checkpatch.pl griping about adding an #if __APPLE__. And since glibc has the same bug with SSIZE_MAX, a configure-based solution would be easier to copy-and-paste if we needed to work around that too (then again, we don't have any use of SSIZE_MAX at the moment). > * we don't have any #if ...SIZE_MAX, but we do have some > for other kinds of _MAX constant. I'll wait a bit longer to see if any other opinions surface, but sounds like I'll probably be doing a v2 and trying for a configure solution. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GL2A78wNaNkJCT1BJalElOtPDX11dMWqO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXhVGbAAoJEKeha0olJ0NqJHUH/34XL4UWlSp8JwvmVw25xrA+ vIm6pjJ3ix+5JEGNHOZZatDpYF8RffAgmkONmDiEG1vHXEYojOOHaRme2UyMMyMM pl9JngrEkfjJBiNhgQP1GuYDPmanN3+cat3cyUEQSrhTHEmtyye6teCCshn6HUhh tEYQqk1TVBmF2EihQgXx/7XtqHXgyvuh7Xhg1tsuNx5Ue8rUYkB62dqoJ2z2EkA4 18TImGqJGRhL960Cglm0JHin5MKs15sQ6vjgPkGYfWL6KTZ3kwyGViMhdqffZdiP xEa+JBZUlKvAtAjdlFTXHXaXmypywiUF7OsWc4ePzC7VBX44FThlE13yN8K7wPM= =NRa1 -----END PGP SIGNATURE----- --GL2A78wNaNkJCT1BJalElOtPDX11dMWqO--