qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 02/29] numa: Allow setting NUMA distance for diff


From: Eric Blake
Subject: Re: [Qemu-devel] [PULL 02/29] numa: Allow setting NUMA distance for different NUMA nodes
Date: Tue, 30 May 2017 10:28:21 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/30/2017 09:01 AM, Eduardo Habkost wrote:

>> The OSX compiler is pickier about format strings than gcc,
>> and neither "MAX_NODES" nor "MAX(anything)" are uint16_t type.
> 
> src and dst are both uint16_t, so MAX(src, dst) is also uint16_t,
> isn't it?  It looks like MAX_NODES is the problem.

No. MAX() invokes arithmetic (both ?: and > operators), and arithmetic
involves default promotion (anything shorter than int becomes 'int').

> +++ b/numa.c
> @@ -232,7 +232,7 @@ static void parse_numa_distance(NumaDistOptions *dist, 
> Error **errp)
>      if (src >= MAX_NODES || dst >= MAX_NODES) {
>          error_setg(errp,
>                     "Invalid node %" PRIu16
> -                   ", max possible could be %" PRIu16,
> +                   ", max possible could be %d",

Don't you want %u to match PRIu16, rather than %d?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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