diff mbox series

public: constify xsd_errors[]

Message ID f37c4fe4-cf0b-224a-f1eb-d5e3c0d990a3@suse.com (mailing list archive)
State New, archived
Headers show
Series public: constify xsd_errors[] | expand

Commit Message

Jan Beulich July 4, 2022, 12:53 p.m. UTC
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.

Comments

Juergen Gross July 4, 2022, 1:01 p.m. UTC | #1
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
diff mbox series

Patch

--- 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