From: Mark Kettenis <kettenis@chello.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Fix compiler warnings
Date: Fri, 23 Aug 2002 17:57:00 -0000 [thread overview]
Message-ID: <200208240041.g7O0fTLP032203@elgar.kettenis.dyndns.org> (raw)
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);
next reply other threads:[~2002-08-24 0:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-23 17:57 Mark Kettenis [this message]
2002-08-25 6:48 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200208240041.g7O0fTLP032203@elgar.kettenis.dyndns.org \
--to=kettenis@chello.nl \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox