From fae01ac059343d153610ec7a8334172e302d495c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Fri, 5 Aug 2022 21:23:10 +0200 Subject: [PATCH] Fix alloca warnings on bsd systems. * nettle-internal.h: Include stdlib.h, fix alloca warnings on BSD. * hmac.c: Delete corresponding include here, no longer needed. --- ChangeLog | 3 +++ hmac.c | 2 -- nettle-internal.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0416b59c..e7dbb612 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2022-08-05 Niels Möller <nisse@lysator.liu.se> + * nettle-internal.h: Include stdlib.h, fix alloca warnings on BSD. + * hmac.c: Delete corresponding include here, no longer needed. + * getopt.c: Include stdlib.h and unistd.h unconditionally, similarly to the gnulib version of this file. diff --git a/hmac.c b/hmac.c index 6ac5e11a..ea356970 100644 --- a/hmac.c +++ b/hmac.c @@ -36,8 +36,6 @@ #endif #include <assert.h> -/* Needed for alloca on freebsd */ -#include <stdlib.h> #include <string.h> #include "hmac.h" diff --git a/nettle-internal.h b/nettle-internal.h index ddc483de..92416400 100644 --- a/nettle-internal.h +++ b/nettle-internal.h @@ -36,6 +36,8 @@ #define NETTLE_INTERNAL_H_INCLUDED #include <assert.h> +/* Needed for alloca on bsd systems. */ +#include <stdlib.h> #include "nettle-meta.h" -- GitLab