From: Collin Funk Date: Sun, 16 Jun 2024 16:40:49 +0000 (-0700) Subject: test: Accommodate C23 compilers. X-Git-Tag: v1.16.92~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18912ccdbaebd06dd93beba3b18697576433e79b;p=thirdparty%2Fautomake.git test: Accommodate C23 compilers. 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. --- diff --git a/NEWS b/NEWS index 7aae0f92f..dd8e23cae 100644 --- 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 804b76727..496378a7a 100644 --- 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 diff --git a/t/yacc-d-basic.sh b/t/yacc-d-basic.sh index cc076148b..df3cfece1 100644 --- a/t/yacc-d-basic.sh +++ b/t/yacc-d-basic.sh @@ -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/' bar/parse.y cat > foo/main.c << 'END' #include "parse.h" +extern int yyparse (void); int main () { return yyparse (); diff --git a/t/yacc-deleted-headers.sh b/t/yacc-deleted-headers.sh index 81957eb86..682dd5f5d 100644 --- a/t/yacc-deleted-headers.sh +++ b/t/yacc-deleted-headers.sh @@ -68,6 +68,7 @@ END cat > main1.c << 'END' #include "parse1.h" +extern int yyparse (void); int main (void) { return ZARDOZ + yyparse (); diff --git a/t/yacc-depend.sh b/t/yacc-depend.sh index e5ad6870c..1f67ecac4 100644 --- a/t/yacc-depend.sh +++ b/t/yacc-depend.sh @@ -48,6 +48,7 @@ END cat > main.c << 'END' #include "foo.h" +extern int yyparse (void); int main(void) { return yyparse (); diff --git a/t/yacc-depend2.sh b/t/yacc-depend2.sh index f0529294e..896b86df4 100644 --- a/t/yacc-depend2.sh +++ b/t/yacc-depend2.sh @@ -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 (); diff --git a/t/yacc-mix-c-cxx.sh b/t/yacc-mix-c-cxx.sh index d454fe244..021b4223d 100644 --- a/t/yacc-mix-c-cxx.sh +++ b/t/yacc-mix-c-cxx.sh @@ -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 ();