This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ARI/commit] enhance suggestion in "sprintf" rule (was: "Re: [commit] Re: New ARI warning Sat May 28 01:53:47 UTC 2011")
> [...] I'll update the ARI documentation to mention xsnprintf
> as well - the xstrprintf suggestion really put me in target-lock mode,
> and I failed to think beyond it...
This is what I checked in. Incidently, I noticed a typo, which
I also fixed (this is the second patch).
--
Joel
Index: gdb_ari.sh
===================================================================
RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -p -r1.108 -r1.109
--- gdb_ari.sh 21 Mar 2011 23:04:02 -0000 1.108
+++ gdb_ari.sh 30 May 2011 19:53:25 -0000 1.109
@@ -1068,7 +1068,7 @@ Replace set_register_cached() with nothi
# or safely allocate a fresh buffer.
BEGIN { doc["sprintf"] = "\
-Do not use sprintf, instead use xstrprintf"
+Do not use sprintf, instead use xsnprintf or xstrprintf"
category["sprintf"] = ari_code
}
/(^|[^_[:alnum:]])sprintf[[:space:]]*\(/ {
Index: gdb_ari.sh
===================================================================
RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -p -r1.109 -r1.110
--- gdb_ari.sh 30 May 2011 19:53:25 -0000 1.109
+++ gdb_ari.sh 30 May 2011 19:55:37 -0000 1.110
@@ -1075,12 +1075,12 @@ Do not use sprintf, instead use xsnprint
fail("sprintf")
}
-BEGIN { doc["vsprint"] = "\
-Do not use vsprint(), instead use xstrvprintf"
- category["vsprint"] = ari_regression
+BEGIN { doc["vsprintf"] = "\
+Do not use vsprintf(), instead use xstrvprintf"
+ category["vsprintf"] = ari_regression
}
-/(^|[^_[:alnum:]])vsprint[[:space:]]*\(/ {
- fail("vsprint")
+/(^|[^_[:alnum:]])vsprintf[[:space:]]*\(/ {
+ fail("vsprintf")
}
BEGIN { doc["asprintf"] = "\