From: Pedro Alves Date: Tue, 17 Nov 2015 15:17:44 +0000 (+0000) Subject: [C++/mingw] Misc alloca casts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ae1c716a162ce43a63c16c37aa8c6caaa484650;p=binutils-gdb.git [C++/mingw] Misc alloca casts gdb/ChangeLog: 2015-11-17 Pedro Alves * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1db663bbb24..6549badec1d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2015-11-17 Pedro Alves + + * 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 * ser-mingw.c (CancelIo_ftype): New typedef. diff --git a/gdb/exec.c b/gdb/exec.c index 3089bb4f42a..2433019dc85 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 55a9f5c516c..58c4ff97c2a 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 bb13522ef77..284fbbb8347 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 e6c396bfa5c..8dfe21127ea 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, "\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);