diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-09-23 15:21:49 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-09-23 15:21:49 +1000 |
commit | 4fc268defe0738c471fea6de5b33d6e356aa7082 (patch) | |
tree | 0c4206756a34fa7ff0b8529856aea00049a01ee7 /jim-json.c | |
parent | d6dc025fd27bf6d5aa669144c239e6773ff68246 (diff) | |
download | jimtcl-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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), |