public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 15/18] -Wwrite-strings: execute_command calls with string literals
Date: Tue, 04 Apr 2017 17:26:00 -0000	[thread overview]
Message-ID: <1491326751-16180-16-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1491326751-16180-1-git-send-email-palves@redhat.com>

This is ugly, but it's just making the uglyness explicit.

All these places would better be calling some API function directly
instead of going through execute_command & friends...

gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <palves@redhat.com>

	* event-top.c (command_line_handler): Add cast to execute_command
	call.
	* record-btrace.c (cmd_record_btrace_bts_start)
	(cmd_record_btrace_pt_start, cmd_record_btrace_start)
	(cmd_record_btrace_start): Add cast to execute_command call.
	* record-full.c (record_full_goto_insn):
	* record.c (record_start, record_stop): Add cast to
	execute_command_to_string calls.
	(cmd_record_start): Add cast to execute_command calls.
---
 gdb/event-top.c     |  2 +-
 gdb/record-btrace.c |  8 ++++----
 gdb/record-full.c   |  2 +-
 gdb/record.c        | 14 +++++++-------
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/gdb/event-top.c b/gdb/event-top.c
index 5d8d077..dd2770a 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -766,7 +766,7 @@ command_line_handler (char *rl)
 	 hung up but GDB is still alive.  In such a case, we just quit
 	 gdb killing the inferior program too.  */
       printf_unfiltered ("quit\n");
-      execute_command ("quit", 1);
+      execute_command ((char *) "quit", 1);
     }
   else if (cmd == NULL)
     {
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index af025e2..61fba1e 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -2897,7 +2897,7 @@ cmd_record_btrace_bts_start (char *args, int from_tty)
 
   TRY
     {
-      execute_command ("target record-btrace", from_tty);
+      execute_command ((char *) "target record-btrace", from_tty);
     }
   CATCH (exception, RETURN_MASK_ALL)
     {
@@ -2919,7 +2919,7 @@ cmd_record_btrace_pt_start (char *args, int from_tty)
 
   TRY
     {
-      execute_command ("target record-btrace", from_tty);
+      execute_command ((char *) "target record-btrace", from_tty);
     }
   CATCH (exception, RETURN_MASK_ALL)
     {
@@ -2941,7 +2941,7 @@ cmd_record_btrace_start (char *args, int from_tty)
 
   TRY
     {
-      execute_command ("target record-btrace", from_tty);
+      execute_command ((char *) "target record-btrace", from_tty);
     }
   CATCH (exception, RETURN_MASK_ALL)
     {
@@ -2949,7 +2949,7 @@ cmd_record_btrace_start (char *args, int from_tty)
 
       TRY
 	{
-	  execute_command ("target record-btrace", from_tty);
+	  execute_command ((char *) "target record-btrace", from_tty);
 	}
       CATCH (exception, RETURN_MASK_ALL)
 	{
diff --git a/gdb/record-full.c b/gdb/record-full.c
index bd95acc..31ff558 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -2788,7 +2788,7 @@ record_full_goto_insn (struct record_full_entry *entry,
 static void
 cmd_record_full_start (char *args, int from_tty)
 {
-  execute_command ("target record-full", from_tty);
+  execute_command ((char *) "target record-full", from_tty);
 }
 
 static void
diff --git a/gdb/record.c b/gdb/record.c
index eff8fe1..16e5b03 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -99,25 +99,25 @@ record_start (const char *method, const char *format, int from_tty)
   if (method == NULL)
     {
       if (format == NULL)
-	execute_command_to_string ("record", from_tty);
+	execute_command_to_string ((char *) "record", from_tty);
       else
 	error (_("Invalid format."));
     }
   else if (strcmp (method, "full") == 0)
     {
       if (format == NULL)
-	execute_command_to_string ("record full", from_tty);
+	execute_command_to_string ((char *) "record full", from_tty);
       else
 	error (_("Invalid format."));
     }
   else if (strcmp (method, "btrace") == 0)
     {
       if (format == NULL)
-	execute_command_to_string ("record btrace", from_tty);
+	execute_command_to_string ((char *) "record btrace", from_tty);
       else if (strcmp (format, "bts") == 0)
-	execute_command_to_string ("record btrace bts", from_tty);
+	execute_command_to_string ((char *) "record btrace bts", from_tty);
       else if (strcmp (format, "pt") == 0)
-	execute_command_to_string ("record btrace pt", from_tty);
+	execute_command_to_string ((char *) "record btrace pt", from_tty);
       else
 	error (_("Invalid format."));
     }
@@ -130,7 +130,7 @@ record_start (const char *method, const char *format, int from_tty)
 void
 record_stop (int from_tty)
 {
-  execute_command_to_string ("record stop", from_tty);
+  execute_command_to_string ((char *) "record stop", from_tty);
 }
 
 /* See record.h.  */
@@ -265,7 +265,7 @@ show_record_debug (struct ui_file *file, int from_tty,
 static void
 cmd_record_start (char *args, int from_tty)
 {
-  execute_command ("target record-full", from_tty);
+  execute_command ((char *) "target record-full", from_tty);
 }
 
 /* Truncate the record log from the present point
-- 
2.5.5

  parent reply	other threads:[~2017-04-04 17:26 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 17:25 [PATCH 00/18] gdb: Enable -Wwrite-strings (aka remove -Wno-write-strings) Pedro Alves
2017-04-04 17:26 ` [PATCH 05/18] -Wwrite-strings: Constify warning_pre_print Pedro Alves
2017-04-04 17:26 ` [PATCH 02/18] -Wwrite-strings: Constify macroexp.c:init_shared_buffer Pedro Alves
2017-04-04 17:26 ` [PATCH 08/18] -Wwrite-strings: Constify mi_cmd_argv_ftype's 'command' parameter Pedro Alves
2017-04-04 17:26 ` [PATCH 01/18] -Wwrite-strings: Constify struct disassemble_info's disassembler_options field Pedro Alves
2017-04-05  7:22   ` Nick Clifton
2017-04-04 17:26 ` [PATCH 14/18] -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload Pedro Alves
2017-04-04 18:37   ` Sergio Durigan Junior
2017-04-05 12:58     ` Pedro Alves
2017-04-05 15:49       ` Sergio Durigan Junior
2017-04-04 17:26 ` Pedro Alves [this message]
2017-04-05  7:13   ` [PATCH 15/18] -Wwrite-strings: execute_command calls with string literals Metzger, Markus T
2017-04-05 13:10     ` Pedro Alves
2017-04-04 17:26 ` [PATCH 16/18] -Wwrite-strings: Some constification in gdb/breakpoint.c Pedro Alves
2017-04-04 17:26 ` [PATCH 09/18] -Wwrite-strings: MI -info-os Pedro Alves
2017-04-04 17:26 ` [PATCH 07/18] -Wwrite-strings: Constify work break character arrays Pedro Alves
2017-04-05  8:46   ` Philipp Rudo
2017-04-05 13:17     ` Pedro Alves
2017-04-04 17:26 ` [PATCH 03/18] -Wwrite-strings: Don't initialize string command variables to empty string Pedro Alves
2017-04-04 17:26 ` [PATCH 06/18] -Wwrite-strings: Constify target_pid_to_str and target_thread_extra_thread_info Pedro Alves
2017-04-04 18:44   ` John Baldwin
2017-04-04 17:26 ` [PATCH 04/18] -Wwrite-strings: Constify shell_escape and plug make_command leak Pedro Alves
2017-04-04 17:31 ` [PATCH 10/18] -Wwrite-strings: gdbserver's 'port' parsing Pedro Alves
2017-04-04 17:32 ` [PATCH 18/18] -Wwrite-strings: Remove -Wno-write-strings Pedro Alves
2019-02-14 16:17   ` Thomas Schwinge
2017-04-04 17:32 ` [PATCH 11/18] -Wwrite-strings: gdbserver/win32-low.c and TARGET_WAITKIND_EXECD Pedro Alves
2017-04-04 17:32 ` [PATCH 13/18] -Wwrite-strings: Wrap PyGetSetDef for construction with string literals Pedro Alves
2017-04-04 18:40   ` Sergio Durigan Junior
2017-04-05 12:35     ` Pedro Alves
2017-04-05 15:48       ` Sergio Durigan Junior
2017-04-05  8:49   ` Philipp Rudo
2017-04-05 13:03     ` Pedro Alves
2017-04-04 17:33 ` [PATCH 12/18] -Wwrite-strings: More fix-old-Python-API wrappers Pedro Alves
2017-04-04 17:36 ` [PATCH 17/18] -Wwrite-strings: The Rest Pedro Alves
2017-04-04 18:44   ` John Baldwin
2017-04-05 12:59     ` Pedro Alves
2017-04-04 18:42 ` [PATCH 00/18] gdb: Enable -Wwrite-strings (aka remove -Wno-write-strings) Sergio Durigan Junior
2017-04-04 19:37 ` Simon Marchi
2017-04-05 18:05 ` Pedro Alves

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=1491326751-16180-16-git-send-email-palves@redhat.com \
    --to=palves@redhat.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).