]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
test: Accommodate C23 compilers.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 16 Jun 2024 16:40:49 +0000 (09:40 -0700)
committerKarl Berry <karl@freefriends.org>
Sun, 16 Jun 2024 16:40:49 +0000 (09:40 -0700)
From https://bugs.gnu.org/71425.

* t/yacc-deleted-headers.sh: Declare yyparse before use.
* t/yacc-depend.sh: Likewise.
* t/yacc-mix-c-cxx.sh: Likewise.
* t/yacc-d-basic.sh: Likewise. Use void instead of empty parameter
list.
* t/yacc-depend2.sh: Likewise.
* NEWS: mention this.
* THANKS: add Collin.

NEWS
THANKS
t/yacc-d-basic.sh
t/yacc-deleted-headers.sh
t/yacc-depend.sh
t/yacc-depend2.sh
t/yacc-mix-c-cxx.sh

diff --git a/NEWS b/NEWS
index 7aae0f92f28936c455912745569a0ec24341bd5b..dd8e23caef907649ad4c9393d70b2edcc5b9e44e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -114,6 +114,9 @@ New in 1.17:
   - tests: avoid some declaration conflicts for lex et al. on SunOS.
     (bug#34151 and others)
 
+  - tests: declare yyparse before use and use (void) parameter lists
+    instead of (), to placate C23. (bug#71425)
+
   - Typos in code and other doc fixes. (bug#68003, bug#68004, et al.)
 
 * Obsolescence:
diff --git a/THANKS b/THANKS
index 804b76727f4852cf75cd64aa4cdea92c259e76a1..496378a7a12a83c39a9d21f2dd56e3c3acf9c889 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -75,6 +75,7 @@ Christina Gratorp               christina.gratorp@gmail.com
 Claudio Fontana                 sick_soul@yahoo.it
 Clifford Wolf                   clifford@clifford.at
 Colin Watson                    cjwatson@ubuntu.com
+Collin Funk                     collin.funk1@gmail.com
 Colomban Wendling               lists.ban@herbesfolles.org
 Dagobert Michelsen              dam@opencsw.org
 Daiki Ueno                      ueno@unixuser.org
index cc076148b80a0e3f1ad03b5bb8b086d825a7107f..df3cfece1431391e1462345ee2680ce057b60ee2 100644 (file)
@@ -49,7 +49,7 @@ cp foo/Makefile.am baz/Makefile.am
 cat > foo/parse.y << 'END'
 %{
 #include "parse.h"
-int yylex () { return 0; }
+int yylex (void) { return 0; }
 void yyerror (const char *s) {}
 %}
 %%
@@ -69,6 +69,7 @@ sed -e 's/parse\.h/y.tab.h/' <foo/parse.y >bar/parse.y
 
 cat > foo/main.c << 'END'
 #include "parse.h"
+extern int yyparse (void);
 int main ()
 {
   return yyparse ();
index 81957eb867dcd439bcd4dcadec6750ca7ad90e1b..682dd5f5d82540a84dd762ab2c62fb115b05b112 100644 (file)
@@ -68,6 +68,7 @@ END
 
 cat > main1.c << 'END'
 #include "parse1.h"
+extern int yyparse (void);
 int main (void)
 {
   return ZARDOZ + yyparse ();
index e5ad6870ce099c88fd0ebe50941c44fb0462e00b..1f67ecac440ee81f4a39b362c123ac300adb060c 100644 (file)
@@ -48,6 +48,7 @@ END
 
 cat > main.c << 'END'
 #include "foo.h"
+extern int yyparse (void);
 int main(void)
 {
   return yyparse ();
index f0529294e369a16ea3de48af6cda423665fe86a5..896b86df489ec5e4ecf1d4dfb7abbc22a9655224 100644 (file)
@@ -43,7 +43,7 @@ END
 
 cat > foo.y << 'END'
 %{
-int yylex () { return 0; }
+int yylex (void) { return 0; }
 void yyerror (const char *s) {}
 %}
 %token TOKEN
@@ -54,6 +54,7 @@ END
 
 cat > main.c << 'END'
 #include "foo.h"
+extern int yyparse (void);
 int main(void)
 {
   return yyparse ();
index d454fe244ebe2af95add117eebc8c681963f5d75..021b4223ddb2ff01653fccc302149fee124f79a3 100644 (file)
@@ -71,6 +71,7 @@ END
 
 cat > 1.c <<'END'
 #include "p.h"
+extern int yyparse (void);
 int main ()
 {
     int new = ZARDOZ;
@@ -80,6 +81,7 @@ int main ()
 END
 
 cat > 2.c <<'END'
+extern int yyparse (void);
 int main ()
 {
     int yyparse ();