[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug

From: Peter Maydell
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers
Date: Tue, 11 Oct 2016 19:23:30 +0100

On 11 October 2016 at 19:12, Eric Blake <address@hidden> wrote:
> On 10/11/2016 01:03 PM, Programmingkid wrote:
>>> +/* Mac OSX has a <stdint.h> bug that incorrectly defines SIZE_MAX with
>>> + * the wrong type. Our replacement isn't usable in preprocessor
>>> + * expressions, but it is sufficient for our needs. */
>>> +#undef SIZE_MAX
>>> +#define SIZE_MAX ((size_t)-1)
>>> +#endif
>>> +
>> I have applied your patch to the most recent git commit 
>> (627eae7d729277c84f8e0ac07a8caab39c92c38d) on Mac  OS 10.6.8. QEMU built 
>> without any problems using gcc 4.9.
> Did you also tweak the code to make sure there was an instance of
> printf("%zu", SIZE_MAX) (or similar)? It's not enough that it compiles
> without complaint (although that helps), but also that the
> compiler-warning-on-printf goes away (which we currently don't have any
> in the tree, because we've been writing '"%zu", (size_t)SIZE_MAX' to
> work around the broken headers).

I have made that check, and tested that the patch causes the
resulting build failure to go away.

I'll apply this to master...

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]