From: Randolph Chung <randolph@tausq.org>
To: gdb-patches@sources.redhat.com
Subject: [patch/minor] fix compile warning in linux-proc.c
Date: Thu, 21 Aug 2003 05:08:00 -0000 [thread overview]
Message-ID: <20030821051149.GB21328@tausq.org> (raw)
While trying to get hppa-linux building with -Werror, I came across one
warning in linux-proc.c that's triggered by -Wformat-nonliteral. This
patch fixes it if anybody cares :)
thanks,
randolph
2003-08-20 Randolph Chung <tausq@debian.org>
* linux-proc.c: rework the code so that it compiles with
-Wformat-nonliteral -Werror
Index: linux-proc.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-proc.c,v
retrieving revision 1.16
diff -u -p -r1.16 linux-proc.c
--- gdb/linux-proc.c 4 Aug 2003 17:08:22 -0000 1.16
+++ gdb/linux-proc.c 21 Aug 2003 04:54:45 -0000
@@ -404,35 +404,46 @@ linux_info_proc_cmd (char *args, int fro
{
long long addr, endaddr, size, offset, inode;
char permissions[8], device[8], filename[MAXPATHLEN];
- char *header_fmt_string, *data_fmt_string;
+ printf_filtered ("Mapped address spaces:\n\n");
if (TARGET_ADDR_BIT == 32)
{
- header_fmt_string = "\t%10s %10s %10s %10s %7s\n";
- data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n";
- }
+ printf_filtered ("\t%10s %10s %10s %10s %7s\n",
+ "Start Addr",
+ " End Addr",
+ " Size", " Offset", "objfile");
+ }
else
- {
- header_fmt_string = " %18s %18s %10s %10s %7s\n";
- data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
- }
-
- printf_filtered ("Mapped address spaces:\n\n");
- printf_filtered (header_fmt_string,
+ {
+ printf_filtered (" %18s %18s %10s %10s %7s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
+ }
while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
&offset, &device[0], &inode, &filename[0]))
{
size = endaddr - addr;
- printf_filtered (data_fmt_string, (unsigned long) addr, /* FIXME: pr_addr */
+
+ if (TARGET_ADDR_BIT == 32)
+ {
+ printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
+ (unsigned long) addr, /* FIXME: pr_addr */
(unsigned long) endaddr,
(int) size,
(unsigned int) offset,
filename[0] ? filename : "");
-
+ }
+ else
+ {
+ printf_filtered (" %#18lx %#18lx %#10x %#10x %7s\n",
+ (unsigned long) addr, /* FIXME: pr_addr */
+ (unsigned long) endaddr,
+ (int) size,
+ (unsigned int) offset,
+ filename[0] ? filename : "");
+ }
}
fclose (procfile);
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
next reply other threads:[~2003-08-21 5:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-21 5:08 Randolph Chung [this message]
2003-08-25 16:48 ` David Carlton
2003-08-27 4:25 ` Andrew Cagney
2003-08-27 15:42 ` David Carlton
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=20030821051149.GB21328@tausq.org \
--to=randolph@tausq.org \
--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