forked from Imagelibrary/binutils-gdb
[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.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2015-11-17 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* ser-mingw.c (CancelIo_ftype): New typedef.
|
* ser-mingw.c (CancelIo_ftype): New typedef.
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ exec_file_attach (const char *filename, int from_tty)
|
|||||||
#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
|
||||||
if (scratch_chan < 0)
|
if (scratch_chan < 0)
|
||||||
{
|
{
|
||||||
char *exename = alloca (strlen (filename) + 5);
|
char *exename = (char *) alloca (strlen (filename) + 5);
|
||||||
|
|
||||||
strcat (strcpy (exename, filename), ".exe");
|
strcat (strcpy (exename, filename), ".exe");
|
||||||
scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST,
|
scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST,
|
||||||
|
|||||||
@@ -1738,7 +1738,7 @@ symfile_bfd_open (const char *name)
|
|||||||
#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
|
#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
|
||||||
if (desc < 0)
|
if (desc < 0)
|
||||||
{
|
{
|
||||||
char *exename = alloca (strlen (expanded_name) + 5);
|
char *exename = (char *) alloca (strlen (expanded_name) + 5);
|
||||||
|
|
||||||
strcat (strcpy (exename, expanded_name), ".exe");
|
strcat (strcpy (exename, expanded_name), ".exe");
|
||||||
desc = openp (getenv ("PATH"),
|
desc = openp (getenv ("PATH"),
|
||||||
|
|||||||
@@ -3356,14 +3356,14 @@ gdb_filename_fnmatch (const char *pattern, const char *string, int flags)
|
|||||||
|
|
||||||
/* Replace '\' by '/' in both strings. */
|
/* Replace '\' by '/' in both strings. */
|
||||||
|
|
||||||
pattern_slash = alloca (strlen (pattern) + 1);
|
pattern_slash = (char *) alloca (strlen (pattern) + 1);
|
||||||
strcpy (pattern_slash, pattern);
|
strcpy (pattern_slash, pattern);
|
||||||
pattern = pattern_slash;
|
pattern = pattern_slash;
|
||||||
for (; *pattern_slash != 0; pattern_slash++)
|
for (; *pattern_slash != 0; pattern_slash++)
|
||||||
if (IS_DIR_SEPARATOR (*pattern_slash))
|
if (IS_DIR_SEPARATOR (*pattern_slash))
|
||||||
*pattern_slash = '/';
|
*pattern_slash = '/';
|
||||||
|
|
||||||
string_slash = alloca (strlen (string) + 1);
|
string_slash = (char *) alloca (strlen (string) + 1);
|
||||||
strcpy (string_slash, string);
|
strcpy (string_slash, string);
|
||||||
string = string_slash;
|
string = string_slash;
|
||||||
for (; *string_slash != 0; string_slash++)
|
for (; *string_slash != 0; string_slash++)
|
||||||
|
|||||||
@@ -2209,7 +2209,7 @@ windows_create_inferior (struct target_ops *ops, char *exec_file,
|
|||||||
To avoid ambiguities introduced by spaces in the module name,
|
To avoid ambiguities introduced by spaces in the module name,
|
||||||
we quote it. */
|
we quote it. */
|
||||||
args_len = strlen (toexec) + 2 /* quotes */ + strlen (allargs) + 2;
|
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);
|
xsnprintf (args, args_len, "\"%s\" %s", toexec, allargs);
|
||||||
|
|
||||||
flags |= DEBUG_ONLY_THIS_PROCESS;
|
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. */
|
/* Windows programs expect the environment block to be sorted. */
|
||||||
qsort (env, i, sizeof (char *), envvar_cmp);
|
qsort (env, i, sizeof (char *), envvar_cmp);
|
||||||
|
|
||||||
w32env = alloca (envlen + 1);
|
w32env = (char *) alloca (envlen + 1);
|
||||||
|
|
||||||
/* Copy env strings into new buffer. */
|
/* Copy env strings into new buffer. */
|
||||||
for (temp = w32env, i = 0; env[i] && *env[i]; i++)
|
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);
|
target_gdbarch (), &obstack);
|
||||||
obstack_grow_str0 (&obstack, "</library-list>\n");
|
obstack_grow_str0 (&obstack, "</library-list>\n");
|
||||||
|
|
||||||
buf = obstack_finish (&obstack);
|
buf = (const char *) obstack_finish (&obstack);
|
||||||
len_avail = strlen (buf);
|
len_avail = strlen (buf);
|
||||||
if (offset >= len_avail)
|
if (offset >= len_avail)
|
||||||
len= 0;
|
len= 0;
|
||||||
@@ -2700,7 +2700,7 @@ _initialize_check_for_gdb_ini (void)
|
|||||||
if (access (oldini, 0) == 0)
|
if (access (oldini, 0) == 0)
|
||||||
{
|
{
|
||||||
int len = strlen (oldini);
|
int len = strlen (oldini);
|
||||||
char *newini = alloca (len + 1);
|
char *newini = (char *) alloca (len + 1);
|
||||||
|
|
||||||
xsnprintf (newini, len + 1, "%.*s.gdbinit",
|
xsnprintf (newini, len + 1, "%.*s.gdbinit",
|
||||||
(int) (len - (sizeof ("gdb.ini") - 1)), oldini);
|
(int) (len - (sizeof ("gdb.ini") - 1)), oldini);
|
||||||
|
|||||||
Reference in New Issue
Block a user