summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-03-16 16:32:11 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-03-16 16:32:11 +0200
commitb7f06447107d4d6e628efad4cb92dfdad900139b (patch)
treeae4320faa3210ff8cb7699aa0d451d182cf50598 /strings
parente5e95a287e2e449a63b3b8badfcc54f8fc84a072 (diff)
downloadmariadb-git-b7f06447107d4d6e628efad4cb92dfdad900139b.tar.gz
MDEV-5313: Fix GCC 10 -Wenum-conversion
Diffstat (limited to 'strings')
-rw-r--r--strings/json_lib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 8a77c41d015..632a0ba989d 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -1872,7 +1872,15 @@ static enum json_types smart_read_value(json_engine_t *je,
*value_len= (int) ((char *) je->s.c_str - *value);
}
- return je->value_type;
+ compile_time_assert((int) JSON_VALUE_OBJECT == (int) JSV_OBJECT);
+ compile_time_assert((int) JSON_VALUE_ARRAY == (int) JSV_ARRAY);
+ compile_time_assert((int) JSON_VALUE_STRING == (int) JSV_STRING);
+ compile_time_assert((int) JSON_VALUE_NUMBER == (int) JSV_NUMBER);
+ compile_time_assert((int) JSON_VALUE_TRUE == (int) JSV_TRUE);
+ compile_time_assert((int) JSON_VALUE_FALSE == (int) JSV_FALSE);
+ compile_time_assert((int) JSON_VALUE_NULL == (int) JSV_NULL);
+
+ return (enum json_types) je->value_type;
err_return:
return JSV_BAD_JSON;