Brad Smith <[email protected]> writes:

> Currently there is a warning for implicit declaration of function for
> alloca() on OpenBSD and
> thus the other BSD's too with ecc-random.c, getopt.c, and pss-mgf1.c.
> The appropriate missing
> header is stdlib.h. What is the preferred method for fixing this? I
> was looking at adding stdlib.h
> to aclocal.m4 in LSH_FUNC_ALLOCA.

That would be the simplest fix, or include stdlib.h explicitly in files
that need it, similar to
https://git.lysator.liu.se/nettle/nettle/-/blob/master/hmac.c#L40. Some
other options:

1. The stuff in LSH_FUNC_ALLOCA was copied more or less verbatim from
the autoconf manual long ago. Maybe it works to just update it to what's
used in the current version of the manual, see
https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Particular-Functions.html

It seems that code includes stddef.h rather than stdlib.h, would that work?

2. For the case of getopt.c, it might make sense to update to the
current version in gnulib, see
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/getopt.c;h=128dc7fcf5417428640c6d1d4555716e41e5209c;hb=HEAD,
not sure how much they have diverged. At least, it does include stdlib.h.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to