[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea
From: |
Nathan Froyd |
Subject: |
Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy. |
Date: |
Mon, 30 Aug 2010 09:55:13 -0700 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
On Mon, Aug 30, 2010 at 10:48:55AM -0500, Anthony Liguori wrote:
> No, this is GCC being stupid.
>
> How else do you terminate a list? IOW:
>
> MyDeviceInfo device_infos[] = {
> {"foo", 0, 2},
> {"bar", 0, 1},
> {} /* or { 0 } */
> };
>
> This is such a pervasive idiom that there's simply no way that GCC can
> possibly try to warn against this. Plus, it's entirely reasonable.
>
> I think this is just a false positive in GCC. Otherwise, there's a ton
> of code that it should be throwing warnings against.
Well, it sounds like Jes was compiling QEMU was extra warning flags, and
I doubt people do much beyond -Wall and maybe one or two others.
I could see petitioning GCC to only complain if -pedantic.
-Nathan
- [Qemu-devel] [PATCH 06/14] Remove unused argument for encrypt_sectors(), (continued)
- [Qemu-devel] [PATCH 06/14] Remove unused argument for encrypt_sectors(), Jes . Sorensen, 2010/08/30
- [Qemu-devel] [PATCH 05/14] Remove unused argument for check_for_block_signature(), Jes . Sorensen, 2010/08/30
- [Qemu-devel] [PATCH 08/14] Remove unused argument for qcow2_encrypt_sectors(), Jes . Sorensen, 2010/08/30
- [Qemu-devel] [PATCH 09/14] Remove unused arguments for add_aio_request() and free_aio_req(), Jes . Sorensen, 2010/08/30
- [Qemu-devel] [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Jes . Sorensen, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., malc, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Richard Henderson, 2010/08/30
[Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Paolo Bonzini, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Anthony Liguori, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Paolo Bonzini, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Anthony Liguori, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Paolo Bonzini, 2010/08/30
- Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy., Jes Sorensen, 2010/08/30
[Qemu-devel] [PATCH 11/14] Remove unused function arguments, Jes . Sorensen, 2010/08/30