Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N63mN-0006oy-67 for qemu-devel@nongnu.org; Thu, 05 Nov 2009 09:57:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N63mG-0006kt-K5 for qemu-devel@nongnu.org; Thu, 05 Nov 2009 09:57:37 -0500 Received: from [199.232.76.173] (port=59607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N63mG-0006kj-Cl for qemu-devel@nongnu.org; Thu, 05 Nov 2009 09:57:32 -0500 Received: from mail.gmx.net ([213.165.64.20]:52104) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1N63mE-00028S-Lv for qemu-devel@nongnu.org; Thu, 05 Nov 2009 09:57:31 -0500 Date: Thu, 5 Nov 2009 15:57:23 +0100 From: Reimar =?iso-8859-1?Q?D=F6ffinger?= Message-ID: <20091105145723.GA4056@1und1.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Subject: [Qemu-devel] VMStateField arrays: shouldn't they be const? List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, with the VMState patches there are now a lot of lines like these: > .fields = (VMStateField []) { Am I missing something or should those actually be const, i.e. > .fields = (const VMStateField []) { ? Last time I looked into it, gcc was unable to take the hint, but e.g. the Intel compiler puts the data then into .rodata instead of .data. While I don't know where the different OSes are in actually supporting it, having it in .rodata means it can't be (accidentally or intentionally) manipulated at runtime, shared between processes and swapped out to the binary instead of the swapfile (or for some architectures with in-place execution support it does not even need to be read from "disk", though I doubt those matter for qemu).