public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [pushed] remote-sim: Add missing ATTRIBUTE_PRINTF
Date: Tue, 20 Feb 2018 16:45:00 -0000	[thread overview]
Message-ID: <1519145110-28409-1-git-send-email-simon.marchi@ericsson.com> (raw)

Fixes:

/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:385:34: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stdout, format, args);
                                 ^~~~~~
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:394:34: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stdout, format, ap);
                                 ^~~~~~
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:402:34: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stderr, format, ap);
                                 ^~~~~~
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:413:11: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
  verror (format, args);
          ^~~~~~
4 errors generated.

gdb/ChangeLog:

	* remote-sim.c (gdb_os_printf_filtered, gdb_os_vprintf_filtered,
	gdb_os_evprintf_filtered, gdb_os_error): Add ATTRIBUTE_PRINTF.
---
 gdb/ChangeLog    |  5 +++++
 gdb/remote-sim.c | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index eac1572..9f78ed3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-20  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* remote-sim.c (gdb_os_printf_filtered, gdb_os_vprintf_filtered,
+	gdb_os_evprintf_filtered, gdb_os_error): Add ATTRIBUTE_PRINTF.
+
 2018-02-20  Markus Metzger  <markus.t.metzger@intel.com>
 
 	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add mkstemp.
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 2f8fb68..456fa8a 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -376,8 +376,8 @@ gdb_os_flush_stderr (host_callback *p)
 
 /* GDB version of printf_filtered callback.  */
 
-static void
-gdb_os_printf_filtered (host_callback * p, const char *format,...)
+static void ATTRIBUTE_PRINTF (2, 3)
+gdb_os_printf_filtered (host_callback * p, const char *format, ...)
 {
   va_list args;
 
@@ -388,7 +388,7 @@ gdb_os_printf_filtered (host_callback * p, const char *format,...)
 
 /* GDB version of error vprintf_filtered.  */
 
-static void
+static void ATTRIBUTE_PRINTF (2, 0)
 gdb_os_vprintf_filtered (host_callback * p, const char *format, va_list ap)
 {
   vfprintf_filtered (gdb_stdout, format, ap);
@@ -396,7 +396,7 @@ gdb_os_vprintf_filtered (host_callback * p, const char *format, va_list ap)
 
 /* GDB version of error evprintf_filtered.  */
 
-static void
+static void ATTRIBUTE_PRINTF (2, 0)
 gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap)
 {
   vfprintf_filtered (gdb_stderr, format, ap);
@@ -404,7 +404,7 @@ gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap)
 
 /* GDB version of error callback.  */
 
-static void
+static void ATTRIBUTE_PRINTF (2, 3)
 gdb_os_error (host_callback * p, const char *format, ...)
 {
   va_list args;
-- 
2.7.4

                 reply	other threads:[~2018-02-20 16:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1519145110-28409-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).