aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-11-17 15:17:44 +0000
committerPedro Alves <palves@redhat.com>2015-11-17 15:18:32 +0000
commit0ae1c716a162ce43a63c16c37aa8c6caaa484650 (patch)
tree630c06563fd7d07422ec860b14472865d79dc327
parentcd78b7a16778046c0cfa4818780ea94a9a90c32c (diff)
downloadgdb-0ae1c716a162ce43a63c16c37aa8c6caaa484650.zip
gdb-0ae1c716a162ce43a63c16c37aa8c6caaa484650.tar.gz
gdb-0ae1c716a162ce43a63c16c37aa8c6caaa484650.tar.bz2
[C++/mingw] Misc alloca casts
gdb/ChangeLog: 2015-11-17 Pedro Alves <palves@redhat.com> * exec.c (exec_file_attach, symfile_bfd_open) [__GO32__ || _WIN32 || __CYGWIN__]: Add casts. * utils.c (gdb_filename_fnmatch): Add cast. * windows-nat.c (windows_create_inferior): Add cast.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/exec.c2
-rw-r--r--gdb/symfile.c2
-rw-r--r--gdb/utils.c4
-rw-r--r--gdb/windows-nat.c8
5 files changed, 15 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1db663b..6549bad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2015-11-17 Pedro Alves <palves@redhat.com>
+ * exec.c (exec_file_attach, symfile_bfd_open) [__GO32__ || _WIN32
+ || __CYGWIN__]: Add casts.
+ * utils.c (gdb_filename_fnmatch): Add cast.
+ * windows-nat.c (windows_create_inferior): Add cast.
+
+2015-11-17 Pedro Alves <palves@redhat.com>
+
* ser-mingw.c (CancelIo_ftype): New typedef.
(CancelIo): Use CancelIo_ftype.
(ser_windows_close, ser_windows_wait_handle)
diff --git a/gdb/exec.c b/gdb/exec.c
index 3089bb4..2433019 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -254,7 +254,7 @@ exec_file_attach (const char *filename, int from_tty)
#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
if (scratch_chan < 0)
{
- char *exename = alloca (strlen (filename) + 5);
+ char *exename = (char *) alloca (strlen (filename) + 5);
strcat (strcpy (exename, filename), ".exe");
scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST,
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 55a9f5c..58c4ff9 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1738,7 +1738,7 @@ symfile_bfd_open (const char *name)
#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
if (desc < 0)
{
- char *exename = alloca (strlen (expanded_name) + 5);
+ char *exename = (char *) alloca (strlen (expanded_name) + 5);
strcat (strcpy (exename, expanded_name), ".exe");
desc = openp (getenv ("PATH"),
diff --git a/gdb/utils.c b/gdb/utils.c
index bb13522..284fbbb 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3356,14 +3356,14 @@ gdb_filename_fnmatch (const char *pattern, const char *string, int flags)
/* Replace '\' by '/' in both strings. */
- pattern_slash = alloca (strlen (pattern) + 1);
+ pattern_slash = (char *) alloca (strlen (pattern) + 1);
strcpy (pattern_slash, pattern);
pattern = pattern_slash;
for (; *pattern_slash != 0; pattern_slash++)
if (IS_DIR_SEPARATOR (*pattern_slash))
*pattern_slash = '/';
- string_slash = alloca (strlen (string) + 1);
+ string_slash = (char *) alloca (strlen (string) + 1);
strcpy (string_slash, string);
string = string_slash;
for (; *string_slash != 0; string_slash++)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index e6c396b..8dfe211 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2209,7 +2209,7 @@ windows_create_inferior (struct target_ops *ops, char *exec_file,
To avoid ambiguities introduced by spaces in the module name,
we quote it. */
args_len = strlen (toexec) + 2 /* quotes */ + strlen (allargs) + 2;
- args = alloca (args_len);
+ args = (char *) alloca (args_len);
xsnprintf (args, args_len, "\"%s\" %s", toexec, allargs);
flags |= DEBUG_ONLY_THIS_PROCESS;
@@ -2249,7 +2249,7 @@ windows_create_inferior (struct target_ops *ops, char *exec_file,
/* Windows programs expect the environment block to be sorted. */
qsort (env, i, sizeof (char *), envvar_cmp);
- w32env = alloca (envlen + 1);
+ w32env = (char *) alloca (envlen + 1);
/* Copy env strings into new buffer. */
for (temp = w32env, i = 0; env[i] && *env[i]; i++)
@@ -2421,7 +2421,7 @@ windows_xfer_shared_libraries (struct target_ops *ops,
target_gdbarch (), &obstack);
obstack_grow_str0 (&obstack, "</library-list>\n");
- buf = obstack_finish (&obstack);
+ buf = (const char *) obstack_finish (&obstack);
len_avail = strlen (buf);
if (offset >= len_avail)
len= 0;
@@ -2700,7 +2700,7 @@ _initialize_check_for_gdb_ini (void)
if (access (oldini, 0) == 0)
{
int len = strlen (oldini);
- char *newini = alloca (len + 1);
+ char *newini = (char *) alloca (len + 1);
xsnprintf (newini, len + 1, "%.*s.gdbinit",
(int) (len - (sizeof ("gdb.ini") - 1)), oldini);