From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KaBLy-0005pw-KQ for qemu-devel@nongnu.org; Mon, 01 Sep 2008 11:30:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaBLw-0005pI-T0 for qemu-devel@nongnu.org; Mon, 01 Sep 2008 11:30:06 -0400 Received: from [199.232.76.173] (port=36378 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaBLw-0005pA-QM for qemu-devel@nongnu.org; Mon, 01 Sep 2008 11:30:04 -0400 Received: from mail2.shareable.org ([80.68.89.115]:33380) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KaBLx-0001LH-24 for qemu-devel@nongnu.org; Mon, 01 Sep 2008 11:30:05 -0400 Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from ) id 1KaBLt-0005Hc-HP for qemu-devel@nongnu.org; Mon, 01 Sep 2008 16:30:01 +0100 Date: Mon, 1 Sep 2008 16:30:01 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH v4 4/8] Use libuuid if available. Message-ID: <20080901153001.GA19996@shareable.org> References: <20080901072531.17854.37681.stgit@gleb-debian.qumranet.com.qumranet.com> <20080901072551.17854.10043.stgit@gleb-debian.qumranet.com.qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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