This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.


Hi.

Just the standard tweak to cope with gcc -Wall.

../../clang/gdb/ada-typeprint.c: In function 'print_range':
../../clang/gdb/ada-typeprint.c:187:23: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      ada_print_scalar (target_type, hi, stream);
                       ^
../../clang/gdb/ada-typeprint.c:185:23: error: 'lo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      ada_print_scalar (target_type, lo, stream);
                       ^
cc1: all warnings being treated as errors


2014-08-18  Doug Evans  <dje@google.com>

	* ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.

diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 57c8d93..27bd1d1 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -160,7 +160,7 @@ print_range (struct type *type, struct ui_file *stream,
       {
 	struct type *target_type;
 	volatile struct gdb_exception e;
-	LONGEST lo, hi;
+	LONGEST lo = 0, hi = 0; /* init for gcc -Wall */
 
 	target_type = TYPE_TARGET_TYPE (type);
 	if (target_type == NULL)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]