bug-bash
[Top][All Lists]
Advanced

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

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


From: Sam James
Subject: [PATCH] aclocal.m4: fix -Wimplicit-function-declaration in dup2 check
Date: Thu, 2 Feb 2023 05:46:24 +0000

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




reply via email to

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