aboutsummaryrefslogtreecommitdiff
path: root/jim-json.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-09-23 15:21:49 +1000
committerSteve Bennett <steveb@workware.net.au>2020-09-23 15:21:49 +1000
commit4fc268defe0738c471fea6de5b33d6e356aa7082 (patch)
tree0c4206756a34fa7ff0b8529856aea00049a01ee7 /jim-json.c
parentd6dc025fd27bf6d5aa669144c239e6773ff68246 (diff)
downloadjimtcl-4fc268defe0738c471fea6de5b33d6e356aa7082.zip
jimtcl-4fc268defe0738c471fea6de5b33d6e356aa7082.tar.gz
jimtcl-4fc268defe0738c471fea6de5b33d6e356aa7082.tar.bz2
build: avoid a spurious compiler warning
When compiled with -Os and arm-linux-musleabihf-gcc (crosstool-NG 1.24.0.92-e2957c3) 9.2.0 Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-json.c')
-rw-r--r--jim-json.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/jim-json.c b/jim-json.c
index 1b3869c..aeeb7cf 100644
--- a/jim-json.c
+++ b/jim-json.c
@@ -141,7 +141,10 @@ json_decode_dump_container(Jim_Interp *interp, struct json_state *state)
json_schema_t container_type = JSON_OBJ; /* JSON_LIST, JSON_MIXED or JSON_OBJ */
if (state->schemaObj) {
- json_schema_t list_type;
+ /* Don't strictly need to initialise this, but some compilers can't figure out it is always
+ * assigned a value below.
+ */
+ json_schema_t list_type = JSON_STR;
/* Figure out the type to use for the container */
if (type == JSMN_ARRAY) {
/* If every element of the array is of the same primitive schema type (str, bool or num),