This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH] Fix compiler warnings


On the alpha LONGEST is symply a long.  Therefore, on alpha systems
that support long long, this will lead to a format string warning.
The attached patch fixes this.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* valprint.c (print_longest) [CC_HAS_LONG_LONG &&
	PRINTF_HAS_LONG_LONG]: Cast val_long to (long long) or (unsigned
	long long) to prevent compiler warning on 64-bit systems.

Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.27
diff -u -p -r1.27 valprint.c
--- valprint.c 29 Jul 2002 16:34:07 -0000 1.27
+++ valprint.c 24 Aug 2002 00:35:10 -0000
@@ -332,7 +332,7 @@ print_longest (struct ui_file *stream, i
       fprintf_filtered (stream,
 			use_local ? local_decimal_format_custom ("ll")
 			: "%lld",
-			val_long);
+			(long long) val_long);
       break;
     case 'u':
       fprintf_filtered (stream, "%llu", (long long) val_long);
@@ -341,13 +341,13 @@ print_longest (struct ui_file *stream, i
       fprintf_filtered (stream,
 			use_local ? local_hex_format_custom ("ll")
 			: "%llx",
-			val_long);
+			(unsigned long long) val_long);
       break;
     case 'o':
       fprintf_filtered (stream,
 			use_local ? local_octal_format_custom ("ll")
 			: "%llo",
-			val_long);
+			(unsigned long long) val_long);
       break;
     case 'b':
       fprintf_filtered (stream, local_hex_format_custom ("02ll"), val_long);


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