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]

Re: [patch/minor] fix compile warning in linux-proc.c


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:

David, feel free to check it in. A comment mentioning that this should use a generic (and not yet existing) local_address_string() method would be useful.


The casts don't phase me. The conflicting "%#10lx" and "%#18lx" do but again not desperatly. That local_address_string custom method.

Andrew


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?




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