[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH 07/14] qemu-io: Don't print NULL w
From: |
Eric Blake |
Subject: |
Re: [Qemu-stable] [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
signature.asc
Description: OpenPGP digital signature
- [Qemu-stable] [PATCH 02/14] block/vvfat: Plug memory leak in enable_write_target(), (continued)
- [Qemu-stable] [PATCH 02/14] block/vvfat: Plug memory leak in enable_write_target(), Markus Armbruster, 2014/05/26
- [Qemu-stable] [PATCH 04/14] block: Plug memory leak on brv_open_image() error path, Markus Armbruster, 2014/05/26
- [Qemu-stable] [PATCH 14/14] qemu-img: Plug memory leak in convert command, Markus Armbruster, 2014/05/26
- [Qemu-stable] [PATCH 07/14] qemu-io: Don't print NULL when open without non-option arg fails, Markus Armbruster, 2014/05/26
- Re: [Qemu-stable] [PATCH 07/14] qemu-io: Don't print NULL when open without non-option arg fails, Kevin Wolf, 2014/05/28
- [Qemu-stable] [PATCH 10/14] block/qapi: Plug memory leak in dump_qobject() case QTYPE_QERROR, Markus Armbruster, 2014/05/26
- [Qemu-stable] [PATCH 09/14] blockdev: Plug memory leak in drive_init(), Markus Armbruster, 2014/05/26