diff options
author | Tom Tromey <tom@tromey.com> | 2018-10-03 16:01:12 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-10-03 20:55:52 -0600 |
commit | 875e539851bb2702f3292f819e220545a8776242 (patch) | |
tree | 3c98ce55459276f9fc569ef54fcb9db3bc655174 /gdb/guile/scm-value.c | |
parent | a4cf95167c83c0b8c9dcd55f475a3b028eb883fc (diff) | |
download | binutils-875e539851bb2702f3292f819e220545a8776242.zip binutils-875e539851bb2702f3292f819e220545a8776242.tar.gz binutils-875e539851bb2702f3292f819e220545a8776242.tar.bz2 |
Avoid two uninitialized warnings from gcc
This avoids a couple of uninitialized warnings from gcc by
initializing the object in question. The one in coffread.c seems like
it could be a latent bug. The one in scm-value.c is harmless, but GCC
can't see that.
gdb/ChangeLog
2018-10-03 Tom Tromey <tom@tromey.com>
* guile/scm-value.c (gdbscm_value_to_string): Initialize
"buffer_contents".
* coffread.c (coff_symtab_read): Initialize "newobj".
Diffstat (limited to 'gdb/guile/scm-value.c')
-rw-r--r-- | gdb/guile/scm-value.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c index 1855860..ca0c075 100644 --- a/gdb/guile/scm-value.c +++ b/gdb/guile/scm-value.c @@ -966,7 +966,8 @@ gdbscm_value_to_string (SCM self, SCM rest) int encoding_arg_pos = -1, errors_arg_pos = -1, length_arg_pos = -1; char *encoding = NULL; SCM errors = SCM_BOOL_F; - gdb_byte *buffer_contents; + /* Avoid an uninitialized warning from gcc. */ + gdb_byte *buffer_contents = nullptr; int length = -1; const char *la_encoding = NULL; struct type *char_type = NULL; |