Missing <stdlib.h> include in lib/autoconf/c.m4

Sam James <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Hello,

When working on Clang 16 (and presumably GCC 14) porting [0], I noticed the following
when building GNU grep 3.8:
```
configure:6215: checking for clang-16 option to enable C11 features
configure:6230: clang-16  -c -g -O2  conftest.c >&5
conftest.c:26:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static char *e (p, i)
             ^
conftest.c:246:3: error: call to undeclared library function 'free' with type 'void (void *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  free (ia);
  ^
conftest.c:246:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'free'
1 warning and 1 error generated.
[...]
```

Tracing it through, it looks like there's a missing <stdlib.h> include for free() in autoconf's lib/autoconf/c.m4 (_AC_C_C99_TEST_GLOBALS).

[0] https://lwn.net/Articles/913505/
[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213

Best,
sam
signature.asc (application/pgp-signature, 358 B)
-----BEGIN PGP SIGNATURE-----

iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY2Xvj18UgAAAAAAuAChp
c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB
NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R
kAwaAP9YNH/BotelcLMfMs2hAKYLu2qIF/bJSRKLmeIcogFM6wEAyphG6RiVPTa2
rEEMMVnnG/ihsmRj9Q0aqdDI5Vk9vgA=
=whmD
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.