qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 4/8] Use libuuid if available.
Date: Mon, 1 Sep 2008 16:30:01 +0100	[thread overview]
Message-ID: <20080901153001.GA19996@shareable.org> (raw)
In-Reply-To: <F5D7F2E4-F67F-408F-884F-0CDBDC4EA739@web.de>

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

  parent reply	other threads:[~2008-09-01 15:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  7:25 [Qemu-devel] [PATCH v4 0/8] Add new firmware configuration mechanism Gleb Natapov
2008-09-01  7:25 ` [Qemu-devel] [PATCH v4 1/8] Key/value based qemu<->guest firmware communication mechanism Gleb Natapov
2008-09-01  7:44   ` Gleb Natapov
2008-09-01  7:25 ` [Qemu-devel] [PATCH v4 2/8] Add -uuid command line option Gleb Natapov
2008-09-01  7:25 ` [Qemu-devel] [PATCH v4 3/8] Add "info uuid" command to monitor Gleb Natapov
2008-09-01  7:25 ` [Qemu-devel] [PATCH v4 4/8] Use libuuid if available Gleb Natapov
2008-09-01 14:25   ` Blue Swirl
2008-09-01 14:49   ` Andreas Färber
2008-09-01 15:15     ` Tomas Carnecky
2008-09-01 16:29       ` M. Warner Losh
2008-09-01 15:30     ` Jamie Lokier [this message]
2008-09-01 16:32       ` Andreas Färber
2008-09-01 15:50     ` Andreas Schwab
2008-09-01 16:29     ` M. Warner Losh
2008-09-01  7:25 ` [Qemu-devel] [PATCH v4 5/8] Add UUID to firmware configuration info Gleb Natapov
2008-09-01  7:26 ` [Qemu-devel] [PATCH v4 6/8] Pass cpu speed into SM BIOS Gleb Natapov
2008-09-01  7:46   ` Gleb Natapov
2008-09-01  7:26 ` [Qemu-devel] [PATCH v4 7/8] Add common keys to firmware configuration Gleb Natapov
2008-09-01  7:26 ` [Qemu-devel] [PATCH v4 8/8] Add sparc " Gleb Natapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080901153001.GA19996@shareable.org \
    --to=jamie@shareable.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).