[PATCH] public: constify xsd_errors[]

Jan Beulich posted 1 patch 1 year, 9 months ago
Failed in applying to current master (apply log)
[PATCH] public: constify xsd_errors[]
Posted by Jan Beulich 1 year, 9 months ago
While in principle this could break existing users, I think such users
deserve to be put in trouble. After all the table should have been const
from the very beginning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Especially since the table definition lives in a header, the adding of
"const" might render redundant the adding of the "unused" attribute. But
I'm not sufficiently certain that all supported gcc versions as well as
compilers claiming gcc compatibility behave consistently in this regard,
so I'm leaving the attribute in place.

--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -71,7 +71,7 @@ struct xsd_errors
 #ifdef EINVAL
 #define XSD_ERROR(x) { x, #x }
 /* LINTED: static unused */
-static struct xsd_errors xsd_errors[]
+static const struct xsd_errors xsd_errors[]
 #if defined(__GNUC__)
 __attribute__((unused))
 #endif
Re: [PATCH] public: constify xsd_errors[]
Posted by Juergen Gross 1 year, 9 months ago
On 04.07.22 14:53, Jan Beulich wrote:
> While in principle this could break existing users, I think such users
> deserve to be put in trouble. After all the table should have been const
> from the very beginning.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen