diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-09-02 10:28:09 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-05 08:53:22 +0100 |
commit | 689eb1462cfdde4f381b8c09c862c54209627e24 (patch) | |
tree | a8050ebd280f59f0b05a8adbb39fd7e9eb00cb6a /meta/recipes-devtools/autoconf | |
parent | 9b1db65e7db4cab89e0ffe235736e1cd7a10740b (diff) | |
download | poky-689eb1462cfdde4f381b8c09c862c54209627e24.tar.gz |
autoconf: Update K & R stype functions
This replaces the proposed patch with a backport of what got accepted upstream
(From OE-Core rev: f3e92b7cb5833f61ff13a66f03be513d97a69894)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/autoconf')
3 files changed, 139 insertions, 65 deletions
diff --git a/meta/recipes-devtools/autoconf/autoconf/0001-Port-to-compilers-that-moan-about-K-R-func-decls.patch b/meta/recipes-devtools/autoconf/autoconf/0001-Port-to-compilers-that-moan-about-K-R-func-decls.patch new file mode 100644 index 0000000000..4f15bf96c3 --- /dev/null +++ b/meta/recipes-devtools/autoconf/autoconf/0001-Port-to-compilers-that-moan-about-K-R-func-decls.patch | |||
@@ -0,0 +1,138 @@ | |||
1 | From 7a3bbca81b803ba116b83c82de378e840cc35f81 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggert <eggert@cs.ucla.edu> | ||
3 | Date: Thu, 1 Sep 2022 16:19:50 -0500 | ||
4 | Subject: [PATCH] Port to compilers that moan about K&R func decls | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | * lib/autoconf/c.m4 (AC_LANG_CALL, AC_LANG_FUNC_LINK_TRY): | ||
10 | Use '(void)' rather than '()' in function prototypes, as the latter | ||
11 | provokes fatal errors in some compilers nowadays. | ||
12 | * lib/autoconf/functions.m4 (AC_FUNC_STRTOD): | ||
13 | * tests/fortran.at (AC_F77_DUMMY_MAIN usage): | ||
14 | * tests/semantics.at (AC_CHECK_DECLS): | ||
15 | Don’t use () in a function decl. | ||
16 | |||
17 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=8b5e2016c7ed2d67f31b03a3d2e361858ff5299b] | ||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | --- | ||
20 | doc/autoconf.texi | 7 +++---- | ||
21 | lib/autoconf/c.m4 | 6 +++--- | ||
22 | lib/autoconf/functions.m4 | 3 --- | ||
23 | tests/fortran.at | 8 ++++---- | ||
24 | tests/semantics.at | 2 +- | ||
25 | 5 files changed, 11 insertions(+), 15 deletions(-) | ||
26 | |||
27 | --- a/doc/autoconf.texi | ||
28 | +++ b/doc/autoconf.texi | ||
29 | @@ -5465,9 +5465,7 @@ the @samp{#undef malloc}): | ||
30 | #include <config.h> | ||
31 | #undef malloc | ||
32 | |||
33 | -#include <sys/types.h> | ||
34 | - | ||
35 | -void *malloc (); | ||
36 | +#include <stdlib.h> | ||
37 | |||
38 | /* Allocate an N-byte block of memory from the heap. | ||
39 | If N is zero, allocate a 1-byte block. */ | ||
40 | @@ -8295,7 +8293,7 @@ needed: | ||
41 | # ifdef __cplusplus | ||
42 | extern "C" | ||
43 | # endif | ||
44 | - int F77_DUMMY_MAIN () @{ return 1; @} | ||
45 | + int F77_DUMMY_MAIN (void) @{ return 1; @} | ||
46 | #endif | ||
47 | @end example | ||
48 | |||
49 | --- a/lib/autoconf/c.m4 | ||
50 | +++ b/lib/autoconf/c.m4 | ||
51 | @@ -127,7 +127,7 @@ m4_if([$2], [main], , | ||
52 | [/* Override any GCC internal prototype to avoid an error. | ||
53 | Use char because int might match the return type of a GCC | ||
54 | builtin and then its argument prototype would still apply. */ | ||
55 | -char $2 ();])], [return $2 ();])]) | ||
56 | +char $2 (void);])], [return $2 ();])]) | ||
57 | |||
58 | |||
59 | # AC_LANG_FUNC_LINK_TRY(C)(FUNCTION) | ||
60 | @@ -151,7 +151,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)], | ||
61 | #define $1 innocuous_$1 | ||
62 | |||
63 | /* System header to define __stub macros and hopefully few prototypes, | ||
64 | - which can conflict with char $1 (); below. */ | ||
65 | + which can conflict with char $1 (void); below. */ | ||
66 | |||
67 | #include <limits.h> | ||
68 | #undef $1 | ||
69 | @@ -162,7 +162,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)], | ||
70 | #ifdef __cplusplus | ||
71 | extern "C" | ||
72 | #endif | ||
73 | -char $1 (); | ||
74 | +char $1 (void); | ||
75 | /* The GNU C library defines this for functions which it implements | ||
76 | to always fail with ENOSYS. Some functions are actually named | ||
77 | something starting with __ and the normal name is an alias. */ | ||
78 | --- a/lib/autoconf/functions.m4 | ||
79 | +++ b/lib/autoconf/functions.m4 | ||
80 | @@ -1601,9 +1601,6 @@ AC_DEFUN([AC_FUNC_STRTOD], | ||
81 | AC_CACHE_CHECK(for working strtod, ac_cv_func_strtod, | ||
82 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||
83 | ]AC_INCLUDES_DEFAULT[ | ||
84 | -#ifndef strtod | ||
85 | -double strtod (); | ||
86 | -#endif | ||
87 | int | ||
88 | main (void) | ||
89 | { | ||
90 | --- a/tests/fortran.at | ||
91 | +++ b/tests/fortran.at | ||
92 | @@ -233,7 +233,7 @@ void FOOBAR_F77 (double *x, double *y); | ||
93 | # ifdef __cplusplus | ||
94 | extern "C" | ||
95 | # endif | ||
96 | - int F77_DUMMY_MAIN () { return 1; } | ||
97 | + int F77_DUMMY_MAIN (void) { return 1; } | ||
98 | #endif | ||
99 | |||
100 | int main(int argc, char *argv[]) | ||
101 | @@ -315,7 +315,7 @@ void FOOBAR_FC(double *x, double *y); | ||
102 | # ifdef __cplusplus | ||
103 | extern "C" | ||
104 | # endif | ||
105 | - int FC_DUMMY_MAIN () { return 1; } | ||
106 | + int FC_DUMMY_MAIN (void) { return 1; } | ||
107 | #endif | ||
108 | |||
109 | int main (int argc, char *argv[]) | ||
110 | @@ -561,7 +561,7 @@ void @foobar@ (int *x); | ||
111 | # ifdef __cplusplus | ||
112 | extern "C" | ||
113 | # endif | ||
114 | - int F77_DUMMY_MAIN () { return 1; } | ||
115 | + int F77_DUMMY_MAIN (void) { return 1; } | ||
116 | #endif | ||
117 | |||
118 | int main(int argc, char *argv[]) | ||
119 | @@ -637,7 +637,7 @@ void @foobar@ (int *x); | ||
120 | # ifdef __cplusplus | ||
121 | extern "C" | ||
122 | # endif | ||
123 | - int FC_DUMMY_MAIN () { return 1; } | ||
124 | + int FC_DUMMY_MAIN (void) { return 1; } | ||
125 | #endif | ||
126 | |||
127 | int main(int argc, char *argv[]) | ||
128 | --- a/tests/semantics.at | ||
129 | +++ b/tests/semantics.at | ||
130 | @@ -207,7 +207,7 @@ AT_CHECK_MACRO([AC_CHECK_DECLS], | ||
131 | [[extern int yes; | ||
132 | enum { myenum }; | ||
133 | extern struct mystruct_s { int x[20]; } mystruct; | ||
134 | - extern int myfunc(); | ||
135 | + extern int myfunc (int); | ||
136 | #define mymacro1(arg) arg | ||
137 | #define mymacro2]]) | ||
138 | # Ensure we can detect missing declarations of functions whose | ||
diff --git a/meta/recipes-devtools/autoconf/autoconf/0001-specify-void-prototype-for-functions-with-no-paramet.patch b/meta/recipes-devtools/autoconf/autoconf/0001-specify-void-prototype-for-functions-with-no-paramet.patch deleted file mode 100644 index 4d8aa296cd..0000000000 --- a/meta/recipes-devtools/autoconf/autoconf/0001-specify-void-prototype-for-functions-with-no-paramet.patch +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | From 7ccfea413216bddd988823acf4e93421ea0f7f9f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 16 Aug 2022 18:35:45 -0700 | ||
4 | Subject: [PATCH] specify void prototype for functions with no parameters | ||
5 | |||
6 | Compilers defaulting to C99 flag such functions as warning which fails | ||
7 | to compile when using -Werror | ||
8 | |||
9 | Fixes | ||
10 | error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] | ||
11 | |||
12 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/autoconf-patches/2022-08/msg00003.html] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | lib/autoconf/c.m4 | 4 ++-- | ||
16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | --- a/lib/autoconf/c.m4 | ||
19 | +++ b/lib/autoconf/c.m4 | ||
20 | @@ -127,7 +127,7 @@ m4_if([$2], [main], , | ||
21 | [/* Override any GCC internal prototype to avoid an error. | ||
22 | Use char because int might match the return type of a GCC | ||
23 | builtin and then its argument prototype would still apply. */ | ||
24 | -char $2 ();])], [return $2 ();])]) | ||
25 | +char $2 (void);])], [return $2 ();])]) | ||
26 | |||
27 | |||
28 | # AC_LANG_FUNC_LINK_TRY(C)(FUNCTION) | ||
29 | @@ -151,7 +151,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)], | ||
30 | #define $1 innocuous_$1 | ||
31 | |||
32 | /* System header to define __stub macros and hopefully few prototypes, | ||
33 | - which can conflict with char $1 (); below. */ | ||
34 | + which can conflict with char $1 (void); below. */ | ||
35 | |||
36 | #include <limits.h> | ||
37 | #undef $1 | ||
38 | @@ -162,7 +162,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)], | ||
39 | #ifdef __cplusplus | ||
40 | extern "C" | ||
41 | #endif | ||
42 | -char $1 (); | ||
43 | +char $1 (void); | ||
44 | /* The GNU C library defines this for functions which it implements | ||
45 | to always fail with ENOSYS. Some functions are actually named | ||
46 | something starting with __ and the normal name is an alias. */ | ||
47 | @@ -252,7 +252,7 @@ dnl other built-in extern "C" functions, | ||
48 | dnl when it actually happens. | ||
49 | [AC_LANG_PROGRAM([[$1 | ||
50 | namespace conftest { | ||
51 | - extern "C" int $2 (); | ||
52 | + extern "C" int $2 (void); | ||
53 | }]], | ||
54 | [[return conftest::$2 ();]])]) | ||
55 | |||
56 | @@ -2457,7 +2457,7 @@ using std::strcmp; | ||
57 | |||
58 | namespace { | ||
59 | |||
60 | -void test_exception_syntax() | ||
61 | +void test_exception_syntax(void) | ||
62 | { | ||
63 | try { | ||
64 | throw "test"; | ||
diff --git a/meta/recipes-devtools/autoconf/autoconf_2.71.bb b/meta/recipes-devtools/autoconf/autoconf_2.71.bb index 239b268119..97c241a3f5 100644 --- a/meta/recipes-devtools/autoconf/autoconf_2.71.bb +++ b/meta/recipes-devtools/autoconf/autoconf_2.71.bb | |||
@@ -18,7 +18,7 @@ SRC_URI = "${GNU_MIRROR}/autoconf/${BP}.tar.gz \ | |||
18 | file://preferbash.patch \ | 18 | file://preferbash.patch \ |
19 | file://autotest-automake-result-format.patch \ | 19 | file://autotest-automake-result-format.patch \ |
20 | file://man-host-perl.patch \ | 20 | file://man-host-perl.patch \ |
21 | file://0001-specify-void-prototype-for-functions-with-no-paramet.patch \ | 21 | file://0001-Port-to-compilers-that-moan-about-K-R-func-decls.patch \ |
22 | " | 22 | " |
23 | SRC_URI:append:class-native = " file://no-man.patch" | 23 | SRC_URI:append:class-native = " file://no-man.patch" |
24 | 24 | ||