bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] aclocal.m4: fix -Wimplicit-function-declaration in dup2 chec


From: Sam James
Subject: Re: [PATCH] aclocal.m4: fix -Wimplicit-function-declaration in dup2 check
Date: Thu, 16 Feb 2023 01:19:04 +0000


> On 2 Feb 2023, at 05:46, Sam James <sam@gentoo.org> wrote:
> 
> dup2 requires a <unistd.h> include. Fixes the following when diffing 
> config.log
> when testing with a stricter compiler:
> ```
> -warning: call to undeclared function 'dup2'; ISO C99 and later do not 
> support implicit function declarations [-Wimplicit-function-declaration]
> +error: call to undeclared function 'dup2'; ISO C99 and later do not support 
> implicit function declarations [-Wimplicit-function-declaration]
> ```
> ---
> aclocal.m4 | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index cc97bd4b..25e20fc2 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -238,6 +238,9 @@ AC_CACHE_VAL(bash_cv_dup2_broken,
> #include <sys/types.h>
> #include <fcntl.h>
> #include <stdlib.h>
> +#ifdef HAVE_UNISTD_H
> +#include <unistd.h>
> +#endif
> int
> main()
> {
> --
> 2.39.1
> 
> 

ping - this should be trivial and fixes some real issues Gentoo and Fedora have 
hit when
doing modern C porting (https://wiki.gentoo.org/wiki/Modern_C_porting,
https://fedoraproject.org/wiki/Changes/PortingToModernC).

Best,
sam

Attachment: signature.asc
Description: Message signed with OpenPGP


reply via email to

[Prev in Thread] Current Thread [Next in Thread]