value: Suppress uninitialized tmp.s warning in value_resize().
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 31 Aug 2020 17:29:52 +0000 (10:29 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 31 Aug 2020 18:03:32 +0000 (11:03 -0700)
This warning is wrong, but it should not cause a performance problem to
avoid it.  Encountered with GCC 10.x.

src/data/value.c

index bbe96b19805a7060945e26bc6eb1ec4d60810583..55a1e55e859952118fa45965d0d376aa85e625d5 100644 (file)
@@ -161,7 +161,7 @@ void
 value_resize (union value *value, int old_width, int new_width)
 {
   assert (value_is_resizable (value, old_width, new_width));
-  if (new_width != old_width)
+  if (new_width != old_width && new_width > 0)
     {
       union value tmp;
       value_init (&tmp, new_width);