Skip to contentSkip to conversation

sae: fix missing reallocarray definition

PATCH Applied James Prestwood 2 participants 2 messages Jan 26, 2022

lore
Share & tools
lore

James Prestwood

author
#0 lore raw

PATCH v2 1/1 sae: fix missing reallocarray definition

Building on GCC 8 resulted in this compiler error. Newer versions seem to find malloc.h without the include, but not on GCC 8.

src/sae.c:107:25: error: implicit declaration of function 'reallocarray';

	did you mean 'realloc'? [-Werror=implicit-function-declaration]
	sm->rejected_groups = reallocarray(NULL, 2, sizeof(uint16_t));
---
 src/sae.c | 2 ++
 1 file changed, 2 insertions(+)
src/sae.c +2 -0
index dc07db4b..9515b455 100644
@@ -24,6 +24,8 @@
 #include <config.h>
 #endif
 
+#include <malloc.h>
+
 #include <ell/ell.h>
 
 #include "src/missing.h"
Signature · 1 line
2.31.1
Applied
#1 lore raw

Hi James,

Quoted 10 lines · James Prestwood

Building on GCC 8 resulted in this compiler error. Newer versions seem to find malloc.h without the include, but not on GCC 8.

src/sae.c:107:25: error: implicit declaration of function 'reallocarray';

	did you mean 'realloc'? [-Werror=implicit-function-declaration]
	sm->rejected_groups = reallocarray(NULL, 2, sizeof(uint16_t));
---
  src/sae.c | 2 ++
  1 file changed, 2 insertions(+)

Applied, thanks.

Regards,
-Denis