[PATCH] Include <alloca.h> conditionally

Simon Marchi simark@simark.ca
Wed Mar 18 01:20:37 GMT 2020


On 2020-03-17 10:03 a.m., Kamil Rytarowski wrote:
> Fixes build on NetBSD, where alloca() is defined in <stdlib.h>.
> ---
>  gdbsupport/common-defs.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
> index 65500ce7634..e42d2b80c04 100644
> --- a/gdbsupport/common-defs.h
> +++ b/gdbsupport/common-defs.h
> @@ -92,7 +92,9 @@
>  #include <strings.h>	/* for strcasecmp and strncasecmp */
>  #endif
>  #include <errno.h>
> +#if HAVE_ALLOCA_H
>  #include <alloca.h>
> +#endif
> 
>  #include "ansidecl.h"
>  /* This is defined by ansidecl.h, but we prefer gnulib's version.  On
> --
> 2.25.0
> 

This is ok, please don't forget the ChangeLog entry.

Simon


More information about the Gdb-patches mailing list