[File] [PATCH] Fix implicit function declarations in configure with Clang 15
Christos Zoulas
christos at zoulas.com
Sun Sep 11 20:57:29 UTC 2022
Committed, thanks!
christos
> On Sep 11, 2022, at 12:15 PM, Sam James <sam at gentoo.org> wrote:
>
> configure gives the following warnings with Clang 15
> (which makes implicit function declaraitons errors
> by default):
> ```
> -warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration]
> +error: call to undeclared function 'atoi'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> atoi(daylight);
> ```
>
> Include <stdlib.h> to avoid the error.
> ---
> acinclude.m4 | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 77b63ff5..edcafed3 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -38,7 +38,8 @@ fi
> AC_CHECK_DECLS([daylight], , , [#include <time.h>])
> AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
> [AC_LINK_IFELSE(
> -[AC_LANG_PROGRAM([#include <time.h>],
> +[AC_LANG_PROGRAM([#include <time.h>
> +#include <stdlib.h>],
> [#if !HAVE_DECL_DAYLIGHT
> extern int daylight;
> #endif
> --
> 2.37.3
>
> --
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20220911/e2071f5e/attachment-0001.asc>
More information about the File
mailing list