[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 4/8] Use libuuid if available.
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] [PATCH v4 4/8] Use libuuid if available. |
Date: |
Mon, 1 Sep 2008 16:30:01 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Andreas Färber wrote:
> >+static int generate_uuid;
>
> Does C99 ensure that generate_uuid gets initialized to zero? Afaik in
> ANSI C it was undefined and needed an explicit assignment.
This is wrong.
In ANSI C (C89) and K&R before it, it is initialised to zero:
http://c-faq.com/decl/initval.html
You might have seen compiler environments where the explicit
assignment is needed. They certainly exist, on some 'embedded' things
like set-top boxes. They are not standard C, but a useful variant.
(This came up in a job interview for me once. The interviewers
criticised a bit of my code for not having the initialiser, because
their embedded environment didn't initialise such variables. The
reasons were good (device startup time), but it was annoying they
believed my code was wrong given they had asked a generic C question,
and didn't believe that their system and the C standard and widely
assumed behaviour didn't match.)
-- Jamie
- [Qemu-devel] [PATCH v4 0/8] Add new firmware configuration mechanism, Gleb Natapov, 2008/09/01
- [Qemu-devel] [PATCH v4 2/8] Add -uuid command line option., Gleb Natapov, 2008/09/01
- [Qemu-devel] [PATCH v4 3/8] Add "info uuid" command to monitor., Gleb Natapov, 2008/09/01
- [Qemu-devel] [PATCH v4 4/8] Use libuuid if available., Gleb Natapov, 2008/09/01
- Re: [Qemu-devel] [PATCH v4 4/8] Use libuuid if available., Andreas Schwab, 2008/09/01
- Re: [Qemu-devel] [PATCH v4 4/8] Use libuuid if available., M. Warner Losh, 2008/09/01
[Qemu-devel] [PATCH v4 5/8] Add UUID to firmware configuration info., Gleb Natapov, 2008/09/01
[Qemu-devel] [PATCH v4 6/8] Pass cpu speed into SM BIOS., Gleb Natapov, 2008/09/01
[Qemu-devel] [PATCH v4 7/8] Add common keys to firmware configuration, Gleb Natapov, 2008/09/01
[Qemu-devel] [PATCH v4 8/8] Add sparc keys to firmware configuration., Gleb Natapov, 2008/09/01
[Qemu-devel] [PATCH v4 1/8] Key/value based qemu<->guest firmware communication mechanism., Gleb Natapov, 2008/09/01