This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: add format attributes to gdb
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 29 Jul 2005 10:12:24 -0400
- Subject: Re: PATCH: add format attributes to gdb
- References: <200507280310.j6S3AvjH011703@caipclassic.rutgers.edu>
On Wed, Jul 27, 2005 at 11:10:57PM -0400, Kaveh R. Ghazi wrote:
> Hi,
>
> This patch adds format attributes in various places in gdb. I found
> these mainly by compiling gdb using a snapshot of gcc-4.1.x with
> -Wmissing-format-attribute. (GCC 4.1.x has some improvements that
> find more places to add missing format attributes.)
>
> In adding these attributes, I used gdb's ATTR_FORMAT macro except
> where I worked on function pointers, in which case I used libiberty's
> ATTRIBUTE_FPTR_PRINTF. (IMHO, gdb's ATTR_FORMAT should go away in
> favor of libiberty's versions, but that's another story.)
>
> I tested this by compiling gdb-6.3.50.20050727 with a recent gcc-4.1.x
> snapshot on x86_64-unknown-linux-gnu plus I compiled gdb using
> gcc-2.95 on sparc-sun-solaris2.7 (to test that I used
> ATTRIBUTE_FPTR_PRINTF vs ATTR_FORMAT in the right places.)
>
> Note: I found zero format specifier errors! (Adding these attributes
> to gdb will help keep it that way.)
It's nice to know that we're perfect... :-)
Kaveh, my only gripe is that you've stuck these markers at the end of a
bunch of lines that were already quite long. You're past eighty columns
in a lot of places. Do you think you could fix that?
The rest of the patch looks just fine, of course.
--
Daniel Jacobowitz
CodeSourcery, LLC