]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Suppress uninitialized-variable warning from less-bright compilers.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Feb 2015 23:19:22 +0000 (18:19 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 28 Feb 2015 15:46:10 +0000 (10:46 -0500)
The type variable must get set on first iteration of the while loop,
but there are reasonably modern gcc versions that don't realize that.
Initialize it with a dummy value.  This undoes a removal of initialization
in commit 654809e770ce270c0bb9de726c5df1ab193d60f0.

src/backend/utils/adt/jsonb.c

index 0a36c44e9b4eac1100dfd241cf73a2f74d838f5a..1d65b251895c372e164f86ce763fb81a4539d20d 100644 (file)
@@ -372,7 +372,7 @@ JsonbToCString(StringInfo out, JsonbContainer *in, int estimated_len)
 {
        bool            first = true;
        JsonbIterator *it;
-       JsonbIteratorToken type;
+       JsonbIteratorToken type = WJB_DONE;
        JsonbValue      v;
        int                     level = 0;
        bool            redo_switch = false;