This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/7] Include alloca.h unconditionally
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Fri, 21 Nov 2014 12:21:18 +0000
- Subject: Re: [PATCH 3/7] Include alloca.h unconditionally
- Authentication-results: sourceware.org; auth=none
- References: <1416057612-16155-1-git-send-email-yao at codesourcery dot com> <1416057612-16155-4-git-send-email-yao at codesourcery dot com>
On 11/15/2014 01:20 PM, Yao Qi wrote:
> diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
> index c70abef..ffe7392 100644
> --- a/gdb/gdbserver/gdbreplay.c
> +++ b/gdb/gdbserver/gdbreplay.c
> @@ -48,9 +48,9 @@
> #if HAVE_NETINET_TCP_H
> #include <netinet/tcp.h>
> #endif
> -#if HAVE_ALLOCA_H
> +
> #include <alloca.h>
> -#endif
> +
> #if HAVE_MALLOC_H
> #include <malloc.h>
> #endif
...
> diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
> index cac73e9..857875a 100644
> --- a/gdb/gdbserver/server.h
> +++ b/gdb/gdbserver/server.h
> @@ -29,9 +29,6 @@ gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
>
> #include "version.h"
>
> -#ifdef HAVE_ALLOCA_H
> -#include <alloca.h>
> -#endif
> /* On some systems such as MinGW, alloca is declared in malloc.h
> (there is no alloca.h). */
> #if HAVE_MALLOC_H
We should remove the malloc.h includes too then, and the check
for malloc.h in configure.ac. It's only included for alloca.
Thanks,
Pedro Alves