There is a warning while building JSON extension code:

  ovs/_json.c: In function 'json_to_python':
  ovs/_json.c:121:49:
    warning: passing argument 1 of 'json_to_python' discards 'const'
             qualifier from pointer target type [-Wdiscarded-qualifiers]
  121 |                 PyObject *item = json_to_python(json_array_at(json, i));
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~
  ovs/_json.c:81:29: note: expected 'struct json *' but argument is
                           of type 'const struct json *'
   81 | json_to_python(struct json *json)
      |                ~~~~~~~~~~~~~^~~~

The warning can be seen in the CI job for the debian package build.

Fixes: 1de4a08c220c ("json: Use functions to access json arrays.")
Signed-off-by: Ilya Maximets <[email protected]>
---
 python/ovs/_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/ovs/_json.c b/python/ovs/_json.c
index bd9f5fe19..371c8fed8 100644
--- a/python/ovs/_json.c
+++ b/python/ovs/_json.c
@@ -78,7 +78,7 @@ Parser_is_done(json_ParserObject * self)
 }
 
 static PyObject *
-json_to_python(struct json *json)
+json_to_python(const struct json *json)
 {
     switch (json->type) {
     case JSON_NULL:
-- 
2.52.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to