Re: [PATCH 3/7] Include alloca.h unconditionally

Pedro Alves
2014-11-21T12:21:27Z

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