qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] vmstate: constify VMStateField


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] vmstate: constify VMStateField
Date: Wed, 14 Nov 2018 17:39:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

Hi Thomas,

On 14/11/18 17:29, Thomas Huth wrote:
On 2018-11-14 16:32, Philippe Mathieu-Daudé wrote:

What about enforcing the constness in the typedef?

-- >8 --
@@ -32 +32 @@ typedef struct VMStateDescription VMStateDescription;
-typedef struct VMStateField VMStateField;
+typedef const struct VMStateField VMStateField;
---

Please don't. For rationale, see:
https://www.kernel.org/doc/html/v4.19/process/coding-style.html#typedefs

Thanks for the pointer, I am interested in understanding why not do that. However in the link you pasted I don't see a rational about enforcing constness, I understand that since this case doesn't match the 5 rules, we should use 'struct VMStateField' directly and remove the typedef.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]