This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/minor] fix compile warning in linux-proc.c
- From: David Carlton <carlton at kealia dot com>
- To: Randolph Chung <randolph at tausq dot org>
- Cc: gdb-patches at sources dot redhat dot com,Andrew Cagney <ac131313 at redhat dot com>
- Date: Mon, 25 Aug 2003 09:48:56 -0700
- Subject: Re: [patch/minor] fix compile warning in linux-proc.c
- References: <20030821051149.GB21328@tausq.org>
On Wed, 20 Aug 2003 22:11:49 -0700, Randolph Chung <randolph@tausq.org> said:
> 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 :)
I'm seeing this on i686-pc-linux-gnu, too. The patch looks fine to me
(though I'm not in a position to approve it); if I were in a
hyper-refactoring mode, I suppose I'd be tempted to create new
functions print_header_format_32, print_data_fmt_32,
print_header_format_64, print_data_fmt_64 defined along these lines:
static void
print_data_fmt_64 (unsigned long addr, unsigned long endaddr,
int size, unsigned int offset, const char *filename) {
printf_filtered (" %#181x %#181x %#10x %#10x %7s\n",
addr, endaddr, size, offset, filename);
}
but I don't think it's really urgent to do so. Hmm; maybe we really
should do that, at least for the data strings, because it gets rid of
casts? Andrew, what do you think?
David Carlton
carlton@kealia.com