[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts |
Date: |
Mon, 28 May 2012 13:52:33 +0100 |
On 28 May 2012 13:39, Stefan Hajnoczi <address@hidden> wrote:
> Agreed, people have been asked to declare variables at the beginning
> of the scope. I don't understand why, C99 allows them to be declared
> anywhere and it usually makes the code more readable IMO (you don't
> have to jump to the definition to check a variable's type).
If the definition is that far away from the use it's probably a
sign that your function is too large anyway and you should be
looking for a smaller scope within which to declare the variable...
> What's the problem with C99-style variable declarations anywhere in a
> function?
I think they look slightly uglier but that's purely a personal
prejudice which I don't think I can justify imposing on anybody
else :-)
-- PMM
- [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Weil, 2012/05/22
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Hajnoczi, 2012/05/23
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Weil, 2012/05/23
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Kevin Wolf, 2012/05/23
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Weil, 2012/05/23
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Hajnoczi, 2012/05/28
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Daniel P. Berrange, 2012/05/28
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Anthony Liguori, 2012/05/29
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Hajnoczi, 2012/05/30
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Peter Maydell, 2012/05/30
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Stefan Hajnoczi, 2012/05/30
- Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Kevin Wolf, 2012/05/30
Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts, Andreas Färber, 2012/05/28