[review] Suppress ARI warnings for vsprintf

Message ID gerrit.1575560698000.Ia8665aa5d7b7331a3985b18626b19764a264447b@gnutoolchain-gerrit.osci.io
State New, archived
Headers

Commit Message

Simon Marchi (Code Review) Dec. 5, 2019, 3:44 p.m. UTC
  Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/747
......................................................................

Suppress ARI warnings for vsprintf

A few spots can validly call vsprintf; this adds ARI markers to
suppress warnings at these places.

gdb/ChangeLog
2019-12-05  Tom Tromey  <tromey@adacore.com>

	* gdbsupport/common-utils.c (string_printf, string_vprintf)
	(string_vappendf): Add ARI comment.

Change-Id: Ia8665aa5d7b7331a3985b18626b19764a264447b
---
M gdb/ChangeLog
M gdb/gdbsupport/common-utils.c
2 files changed, 8 insertions(+), 3 deletions(-)
  

Comments

Simon Marchi (Code Review) Dec. 5, 2019, 4:57 p.m. UTC | #1
Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/747
......................................................................


Patch Set 1: Code-Review+2
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index aa7e9ab..aff1f2f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@ 
 2019-12-05  Tom Tromey  <tromey@adacore.com>
 
+	* gdbsupport/common-utils.c (string_printf, string_vprintf)
+	(string_vappendf): Add ARI comment.
+
+2019-12-05  Tom Tromey  <tromey@adacore.com>
+
 	* gdb_regex.h: Add ARI comments.
 	* gdb_vfork.h: Add ARI comment.
 
diff --git a/gdb/gdbsupport/common-utils.c b/gdb/gdbsupport/common-utils.c
index d1059de..33f9bf6a 100644
--- a/gdb/gdbsupport/common-utils.c
+++ b/gdb/gdbsupport/common-utils.c
@@ -89,7 +89,7 @@ 
   /* C++11 and later guarantee std::string uses contiguous memory and
      always includes the terminating '\0'.  */
   va_start (vp, fmt);
-  vsprintf (&str[0], fmt, vp);
+  vsprintf (&str[0], fmt, vp);	/* ARI: vsprintf */
   va_end (vp);
 
   return str;
@@ -111,7 +111,7 @@ 
 
   /* C++11 and later guarantee std::string uses contiguous memory and
      always includes the terminating '\0'.  */
-  vsprintf (&str[0], fmt, args);
+  vsprintf (&str[0], fmt, args); /* ARI: vsprintf */
 
   return str;
 }
@@ -147,7 +147,7 @@ 
 
   /* C++11 and later guarantee std::string uses contiguous memory and
      always includes the terminating '\0'.  */
-  vsprintf (&str[curr_size], fmt, args);
+  vsprintf (&str[curr_size], fmt, args); /* ARI: vsprintf */
 }
 
 char *