summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/expect/expect/expect-configure-c99.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/expect/expect/expect-configure-c99.patch')
-rw-r--r--meta/recipes-devtools/expect/expect/expect-configure-c99.patch201
1 files changed, 201 insertions, 0 deletions
diff --git a/meta/recipes-devtools/expect/expect/expect-configure-c99.patch b/meta/recipes-devtools/expect/expect/expect-configure-c99.patch
new file mode 100644
index 0000000000..09bf180df7
--- /dev/null
+++ b/meta/recipes-devtools/expect/expect/expect-configure-c99.patch
@@ -0,0 +1,201 @@
1Avoid calling exit without declaring the function.
2
3Add missing <string.h> include for memcpy.
4
5Use AC_TYPE_SIGNAL to fix REARM_SIG check. Add missing includes.
6
7Fix various implicit int return types of main.
8
9Upstream-Status: Submitted [https://sourceforge.net/p/expect/patches/24/]
10Signed-off-by: Ross Burton <ross.burton@arm.com>
11
12diff --git a/configure.in b/configure.in
13index 51558fa14d2bcf7e..055c88fbd8797eaa 100755
14--- a/configure.in
15+++ b/configure.in
16@@ -452,7 +452,11 @@ AC_CHECK_FUNC(siglongjmp, AC_DEFINE(HAVE_SIGLONGJMP))
17 # because Unixware 2.0 handles it specially and refuses to compile
18 # autoconf's automatic test that is a call with no arguments
19 AC_MSG_CHECKING([for memcpy])
20-AC_TRY_LINK(,[
21+AC_TRY_LINK([
22+#ifdef HAVE_STRING_H
23+#include <string.h>
24+#endif
25+],[
26 char *s1, *s2;
27 memcpy(s1,s2,0);
28 ],
29@@ -469,6 +473,7 @@ memcpy(s1,s2,0);
30 AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
31 AC_TRY_RUN([
32 #include <sys/wait.h>
33+int
34 main() {
35 #ifndef WNOHANG
36 return 0;
37@@ -489,6 +494,7 @@ rm -rf wnohang
38 AC_TRY_RUN([
39 #include <stdio.h>
40 #include <sys/wait.h>
41+int
42 main() {
43 #ifdef WNOHANG
44 FILE *fp = fopen("wnohang","w");
45@@ -527,16 +533,21 @@ else
46 AC_DEFINE(SELECT_MASK_TYPE, fd_set)
47 fi
48
49-dnl # Check for the data type of the function used in signal(). This
50-dnl # must be before the test for rearming.
51-dnl # echo checking return type of signal handlers
52-dnl AC_HEADER_EGREP([(void|sighandler_t).*signal], signal.h, retsigtype=void,AC_DEFINE(RETSIGTYPE, int) retsigtype=int)
53+AC_TYPE_SIGNAL
54
55 # FIXME: check if alarm exists
56 AC_MSG_CHECKING([if signals need to be re-armed])
57 AC_TRY_RUN([
58 #include <signal.h>
59-#define RETSIGTYPE $retsigtype
60+#ifdef HAVE_STDLIB_H
61+# include <stdlib.h>
62+#endif
63+#ifdef HAVE_UNISTD_H
64+# include <unistd.h>
65+#endif
66+#ifndef NO_SYS_WAIT_H
67+# include <sys/wait.h>
68+#endif
69
70 int signal_rearms = 0;
71
72@@ -553,6 +564,7 @@ int n;
73 signal_rearms++;
74 }
75
76+int
77 main()
78 {
79 signal(SIGINT,parent_sigint_handler);
80@@ -714,10 +726,11 @@ fi
81 AC_MSG_CHECKING([for struct sgttyb])
82 AC_TRY_RUN([
83 #include <sgtty.h>
84+int
85 main()
86 {
87 struct sgttyb tmp;
88- exit(0);
89+ return 0;
90 }],
91 AC_MSG_RESULT(yes)
92 AC_DEFINE(HAVE_SGTTYB)
93@@ -738,10 +751,11 @@ if test $mach -eq 0 ; then
94 # pty_termios.c is set up to handle pty_termio.
95 AC_MSG_CHECKING([for struct termio])
96 AC_TRY_RUN([#include <termio.h>
97+ int
98 main()
99 {
100 struct termio tmp;
101- exit(0);
102+ return 0;
103 }],
104 AC_DEFINE(HAVE_TERMIO)
105 PTY_TYPE=termios
106@@ -760,10 +774,11 @@ if test $mach -eq 0 ; then
107 # include <inttypes.h>
108 # endif
109 # include <termios.h>
110+ int
111 main()
112 {
113 struct termios tmp;
114- exit(0);
115+ return 0;
116 }],
117 AC_DEFINE(HAVE_TERMIOS)
118 PTY_TYPE=termios
119@@ -782,6 +797,7 @@ AC_TRY_RUN([
120 #include <inttypes.h>
121 #endif
122 #include <termios.h>
123+int
124 main() {
125 #if defined(TCGETS) || defined(TCGETA)
126 return 0;
127@@ -804,6 +820,7 @@ AC_TRY_RUN([
128 #include <inttypes.h>
129 #endif
130 #include <termios.h>
131+int
132 main() {
133 #ifdef TIOCGWINSZ
134 return 0;
135@@ -823,6 +840,7 @@ main() {
136 AC_MSG_CHECKING([for Cray-style ptys])
137 SETUID=":"
138 AC_TRY_RUN([
139+int
140 main(){
141 #ifdef CRAY
142 return 0;
143@@ -878,12 +896,13 @@ AC_MSG_CHECKING([for SV-style timezone])
144 AC_TRY_RUN([
145 extern char *tzname[2];
146 extern int daylight;
147+int
148 main()
149 {
150 int *x = &daylight;
151 char **y = tzname;
152
153- exit(0);
154+ return 0;
155 }],
156 AC_DEFINE(HAVE_SV_TIMEZONE)
157 AC_MSG_RESULT(yes),
158diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4
159index 0689cab3da994068..ebe839e5553ba520 100644
160--- a/tclconfig/tcl.m4
161+++ b/tclconfig/tcl.m4
162@@ -2400,7 +2400,7 @@ AC_DEFUN([TEA_TIME_HANDLER], [
163 AC_TRY_COMPILE([#include <time.h>],
164 [extern long timezone;
165 timezone += 1;
166- exit (0);],
167+ return 0;],
168 tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
169 if test $tcl_cv_timezone_long = yes ; then
170 AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
171@@ -2412,7 +2412,7 @@ AC_DEFUN([TEA_TIME_HANDLER], [
172 AC_TRY_COMPILE([#include <time.h>],
173 [extern time_t timezone;
174 timezone += 1;
175- exit (0);],
176+ return 0;],
177 tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
178 if test $tcl_cv_timezone_time = yes ; then
179 AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
180@@ -2452,17 +2452,17 @@ AC_DEFUN([TEA_BUGGY_STRTOD], [
181 double value;
182 value = strtod(infString, &term);
183 if ((term != infString) && (term[-1] == 0)) {
184- exit(1);
185+ return 1;
186 }
187 value = strtod(nanString, &term);
188 if ((term != nanString) && (term[-1] == 0)) {
189- exit(1);
190+ return 1;
191 }
192 value = strtod(spaceString, &term);
193 if (term == (spaceString+1)) {
194- exit(1);
195+ return 1;
196 }
197- exit(0);
198+ return 0;
199 }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
200 tcl_cv_strtod_buggy=buggy)])
201 if test "$tcl_cv_strtod_buggy" = buggy; then