qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 07/14] qemu-io: Don't print NULL when open witho


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 07/14] qemu-io: Don't print NULL when open without non-option arg fails
Date: Tue, 27 May 2014 08:59:20 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/27/2014 04:41 AM, Benoît Canet wrote:

>> -            fprintf(stderr, "%s: can't open device %s: %s\n", progname, 
>> name,
>> +            fprintf(stderr, "%s: can't open%s%s: %s\n", progname,
>> +                    name ? " device " : "", name ?: "",
> 
> name ?: "" seems to be a GNU C extension: see
> http://en.wikipedia.org/wiki/%3F:#C
> 
> Don't we want this code to work on most compilers ?

It already works on all 2 compilers we actively support (gcc and clang),
and this is not the first instance of this extension in the code base:

$ git grep '\?:' | wc
    210    1081   15271

If it ever becomes a real portability problem to someone trying to port
to another compiler, it would be a search-and-replace fix to the whole
tree at that time.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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