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]

[patch:rfc, rfa:doco] Add -Wformat-nonliteral to -Werror list


Hello,

This adds the GCC -Werror option -Wformat-nonliteral to GDB's compiler warning list. Fixing this one turned out to be easy.

I'll look to commit in a week,
Eli, the doco?

Andrew
2003-07-15  Andrew Cagney  <cagney@redhat.com>

	* configure.in (build_warnings): Add -Wformat-nonliteral.
	* configure: Re-generate.

Index: doc/ChangeLog
2003-07-15  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Coding): Add -Wformat-nonliteral to -Werror
	list.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.128
diff -u -r1.128 configure.in
--- configure.in	8 Jun 2003 18:27:13 -0000	1.128
+++ configure.in	15 Jul 2003 15:47:37 -0000
@@ -976,7 +976,7 @@
 # NOTE: If you add to this list, remember to update
 # gdb/doc/gdbint.texinfo.
 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral"
 # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
 # -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
 # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.155
diff -u -r1.155 gdbint.texinfo
--- doc/gdbint.texinfo	22 Jun 2003 04:28:04 -0000	1.155
+++ doc/gdbint.texinfo	15 Jul 2003 15:47:41 -0000
@@ -5009,8 +5009,9 @@
 @item -Wtrigraphs
 
 @item -Wformat
+@itemx -Wformat-nonliteral
 Since @value{GDBN} uses the @code{format printf} attribute on all
-@code{printf} like functions this checks not just @code{printf} calls
+@code{printf} like functions these check not just @code{printf} calls
 but also calls to functions such as @code{fprintf_unfiltered}.
 
 @item -Wparentheses

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