From: Ralf Wildenhues Date: Fri, 1 Sep 2006 16:19:56 +0000 (+0000) Subject: Drop K&R support from testsuite in favor of C89. X-Git-Tag: release-2-1b~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44383fc00fdc1e3ad3985f19553bc83c20045654;p=thirdparty%2Flibtool.git Drop K&R support from testsuite in favor of C89. * tests/duplicate_members.at: provide declarations of used functions. * tests/testsuite.at: Drop unneeded arguments. * tests/cdemo/main.c: Assume C89. * tests/demo/dlmain.c: Likewise. * tests/demo/main.c: Likewise. * tests/depdemo/main.c: Likewise. * tests/depdemo/l1/l1.c: Likewise. * tests/depdemo/l2/l2.c: Likewise. * tests/depdemo/l3/l3.c: Likewise. * tests/depdemo/l4/l4.c: Likewise. * tests/f77demo/cprogram.c: Likewise. * tests/fcdemo/cprogram.c: Likewise. * tests/mdemo/mlib.c: Likewise. * tests/mdemo2/main.c: Likewise. * tests/pdemo/longer_file_name_dlmain.c: Likewise. * tests/pdemo/longer_file_name_main.c: Likewise. * tests/fcdemo/fooc.c: Reformat. * tests/mdemo/sub.c: Likewise. --- diff --git a/ChangeLog b/ChangeLog index 420f59c43..8f34d1613 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2006-09-01 Ralf Wildenhues + + Drop K&R support from testsuite in favor of C89. + + * tests/duplicate_members.at: provide declarations of used + functions. + * tests/testsuite.at: Drop unneeded arguments. + * tests/cdemo/main.c: Assume C89. + * tests/demo/dlmain.c: Likewise. + * tests/demo/main.c: Likewise. + * tests/depdemo/main.c: Likewise. + * tests/depdemo/l1/l1.c: Likewise. + * tests/depdemo/l2/l2.c: Likewise. + * tests/depdemo/l3/l3.c: Likewise. + * tests/depdemo/l4/l4.c: Likewise. + * tests/f77demo/cprogram.c: Likewise. + * tests/fcdemo/cprogram.c: Likewise. + * tests/mdemo/mlib.c: Likewise. + * tests/mdemo2/main.c: Likewise. + * tests/pdemo/longer_file_name_dlmain.c: Likewise. + * tests/pdemo/longer_file_name_main.c: Likewise. + * tests/fcdemo/fooc.c: Reformat. + * tests/mdemo/sub.c: Likewise. + 2006-08-31 Ralf Wildenhues * tests/mdemo/main.c: Fix bogus line in last patch. diff --git a/tests/cdemo/main.c b/tests/cdemo/main.c index fb85e94eb..aa4bddc2d 100644 --- a/tests/cdemo/main.c +++ b/tests/cdemo/main.c @@ -1,5 +1,5 @@ /* main.c -- cdemo test program - Copyright (C) 1998-1999 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner This file is part of GNU Libtool. @@ -23,9 +23,7 @@ USA. */ int -main (argc,argv) - int argc; - char **argv; +main () { int value; diff --git a/tests/demo/dlmain.c b/tests/demo/dlmain.c index ff4fed8c6..abc931fc1 100644 --- a/tests/demo/dlmain.c +++ b/tests/demo/dlmain.c @@ -1,5 +1,5 @@ /* dlmain.c -- hello test program that uses simulated dynamic linking - Copyright (C) 1996-1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1996-1999, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -35,9 +35,7 @@ struct lt_symlist extern const struct lt_symlist lt_preloaded_symbols[]; int -main (argc, argv) - int argc; - char **argv; +main () { const struct lt_symlist *s; int (*pfoo)() = 0; diff --git a/tests/demo/main.c b/tests/demo/main.c index fe1d2ee60..a00b1238d 100644 --- a/tests/demo/main.c +++ b/tests/demo/main.c @@ -1,5 +1,5 @@ /* main.c -- trivial hello test program - Copyright (C) 1996-1999 Free Software Foundation, Inc. + Copyright (C) 1996-1999, 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -22,9 +22,7 @@ USA. */ #include int -main (argc, argv) - int argc; - char **argv; +main () { printf ("Welcome to GNU Hell!\n"); diff --git a/tests/depdemo/l1/l1.c b/tests/depdemo/l1/l1.c index 1edc62602..b85592924 100644 --- a/tests/depdemo/l1/l1.c +++ b/tests/depdemo/l1/l1.c @@ -1,5 +1,6 @@ /* l1.c -- trivial test library Copyright (C) 1998-1999 Thomas Tanner + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -23,8 +24,7 @@ USA. */ int var_l1 = 0; int -func_l1(indent) - int indent; +func_l1 (int indent) { int i; diff --git a/tests/depdemo/l2/l2.c b/tests/depdemo/l2/l2.c index 01a87981e..69e0d83d4 100644 --- a/tests/depdemo/l2/l2.c +++ b/tests/depdemo/l2/l2.c @@ -1,5 +1,6 @@ /* l2.c -- trivial test library Copyright (C) 1998-1999 Thomas Tanner + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -25,8 +26,7 @@ USA. */ int var_l2 = 0; int -func_l2(indent) - int indent; +func_l2 (int indent) { int i; diff --git a/tests/depdemo/l3/l3.c b/tests/depdemo/l3/l3.c index f6b712c0f..cc1efec96 100644 --- a/tests/depdemo/l3/l3.c +++ b/tests/depdemo/l3/l3.c @@ -1,5 +1,6 @@ /* l3.c -- trivial test library Copyright (C) 1998-1999 Thomas Tanner + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -26,8 +27,7 @@ USA. */ int var_l3 = 0; int -func_l3(indent) - int indent; +func_l3 (int indent) { int i; diff --git a/tests/depdemo/l4/l4.c b/tests/depdemo/l4/l4.c index 92197de25..392c40912 100644 --- a/tests/depdemo/l4/l4.c +++ b/tests/depdemo/l4/l4.c @@ -1,5 +1,6 @@ /* l4.c -- trivial test library Copyright (C) 1998-1999 Thomas Tanner + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -29,8 +30,7 @@ USA. */ int var_l4 = 0; int -func_l4(indent) - int indent; +func_l4 (int indent) { int i; diff --git a/tests/depdemo/main.c b/tests/depdemo/main.c index 3d68a71aa..895aaf44a 100644 --- a/tests/depdemo/main.c +++ b/tests/depdemo/main.c @@ -1,5 +1,5 @@ /* main.c -- inter-library dependency test program - Copyright (C) 1998, 1999, 2000 Free Software Foundation + Copyright (C) 1998, 1999, 2000, 2006 Free Software Foundation by Thomas Tanner This file is part of GNU Libtool. @@ -25,9 +25,7 @@ USA. */ #include int -main (argc,argv) - int argc; - char **argv; +main (int argc, char **argv) { printf("dependencies:\n"); func_l1(0); diff --git a/tests/duplicate_members.at b/tests/duplicate_members.at index 3d201e35a..8c6841d1b 100755 --- a/tests/duplicate_members.at +++ b/tests/duplicate_members.at @@ -27,8 +27,9 @@ chmod +x ./libtool LIBTOOL=./libtool AT_DATA(bar.c, -[[int bar() { - int result=foo1() +foo2() +foo3() +foo4() +foo5() +foo6(); +[[extern int foo1 (), foo2 (), foo3 (), foo4 (), foo5 (), foo6 (); +int bar() { + int result = foo1 () + foo2 () + foo3 () + foo4 () + foo5 () + foo6 (); return result; } ]]) diff --git a/tests/f77demo/cprogram.c b/tests/f77demo/cprogram.c index da043e7b7..0952b433c 100644 --- a/tests/f77demo/cprogram.c +++ b/tests/f77demo/cprogram.c @@ -1,4 +1,7 @@ -/* +/* cprogram.c + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. + This file is part of GNU Libtool. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -18,7 +21,7 @@ USA. */ #include int -main(int argc, char **argv) +main () { int arg,cres,fres; diff --git a/tests/fcdemo/cprogram.c b/tests/fcdemo/cprogram.c index 65e60ccd9..e91db0b7c 100644 --- a/tests/fcdemo/cprogram.c +++ b/tests/fcdemo/cprogram.c @@ -1,4 +1,7 @@ -/* +/* cprogram.c + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. + This file is part of GNU Libtool. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -18,28 +21,28 @@ USA. */ #include int -main(int argc, char **argv) +main () { int arg,cres,fres; printf ("Welcome to GNU libtool mixed C/Fortran demo!\n"); - arg=2; + arg = 2; - cres=csub(arg); + cres = csub (arg); printf ("The C subroutine returned, claiming that 2*%d = %d\n",arg,cres); - if(cres==2*arg) + if (cres == 2*arg) printf ("The C subroutine is ok!\n"); - printf("\nCalling the C wrapper routine...\n"); - fres=fwrapper(arg); + printf ("\nCalling the C wrapper routine...\n"); + fres = fwrapper (arg); printf ("The C wrapper to the fortran subroutine returned,\n" "claiming that 2*%d = %d\n",arg,fres); - if(fres==2*arg) + if (fres == 2*arg) printf ("The Fortran subroutine is ok!\n"); return 0; diff --git a/tests/fcdemo/fooc.c b/tests/fcdemo/fooc.c index 8f1140912..9d40594f1 100644 --- a/tests/fcdemo/fooc.c +++ b/tests/fcdemo/fooc.c @@ -1,13 +1,13 @@ #include "foo.h" #include -int csub(int arg) +int csub (int arg) { - return (2*arg); + return 2*arg; } -int fwrapper(int arg) +int fwrapper (int arg) { int res; printf("Calling the Fortran subroutine from the C wrapper...\n"); diff --git a/tests/mdemo/mlib.c b/tests/mdemo/mlib.c index d14b469e5..0edffbd8d 100644 --- a/tests/mdemo/mlib.c +++ b/tests/mdemo/mlib.c @@ -1,5 +1,5 @@ -/* main.c -- mlib library - Copyright (C) 2002 Free Software Foundation, Inc. +/* mlib.c -- mlib library + Copyright (C) 2002, 2006 Free Software Foundation, Inc. Originally by greg Eisenhauer Extracted from mdemo.c This file is part of GNU Libtool. @@ -24,8 +24,7 @@ USA. */ #include int -test_dl (filename) - char *filename; +test_dl (char *filename) { lt_dlhandle handle; const lt_dlinfo *info; @@ -109,10 +108,9 @@ test_dl (filename) lt_dlclose(handle); return ret; } + int -mlib_func(argc, argv) -int argc; -char **argv; +mlib_func (int argc, char **argv) { int ret = 0; int i; diff --git a/tests/mdemo/sub.c b/tests/mdemo/sub.c index 13da3f617..6fa84eba2 100644 --- a/tests/mdemo/sub.c +++ b/tests/mdemo/sub.c @@ -1,5 +1,5 @@ /* sub.c -- trivial test library - Copyright (C) 1998-1999 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner This file is part of GNU Libtool. @@ -21,7 +21,7 @@ USA. */ #include void -sub() +sub () { printf ("sub() called\n"); } diff --git a/tests/mdemo2/main.c b/tests/mdemo2/main.c index aba875551..4f6da8a36 100644 --- a/tests/mdemo2/main.c +++ b/tests/mdemo2/main.c @@ -1,5 +1,5 @@ /* main.c -- mdemo2 test program - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 Free Software Foundation, Inc. Originally by Greg Eisenhauer < eisen at cc.gatech.edu > This file is part of GNU Libtool. @@ -21,12 +21,10 @@ USA. */ #include #include "ltdl.h" -extern int mlib_func(); +extern int mlib_func (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int ret = 0; diff --git a/tests/pdemo/longer_file_name_dlmain.c b/tests/pdemo/longer_file_name_dlmain.c index ff4fed8c6..6c31e6d79 100644 --- a/tests/pdemo/longer_file_name_dlmain.c +++ b/tests/pdemo/longer_file_name_dlmain.c @@ -1,5 +1,5 @@ /* dlmain.c -- hello test program that uses simulated dynamic linking - Copyright (C) 1996-1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1996-1999, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -35,9 +35,7 @@ struct lt_symlist extern const struct lt_symlist lt_preloaded_symbols[]; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { const struct lt_symlist *s; int (*pfoo)() = 0; diff --git a/tests/pdemo/longer_file_name_main.c b/tests/pdemo/longer_file_name_main.c index 9e0d84f17..9aa32d1af 100644 --- a/tests/pdemo/longer_file_name_main.c +++ b/tests/pdemo/longer_file_name_main.c @@ -1,5 +1,5 @@ /* main.c -- trivial hello test program - Copyright (C) 1996-1999 Free Software Foundation, Inc. + Copyright (C) 1996-1999, 2006 Free Software Foundation, Inc. This file is part of GNU Libtool. This program is free software; you can redistribute it and/or modify @@ -22,9 +22,7 @@ USA. */ #include int -main (argc, argv) - int argc; - char **argv; +main () { printf ("Welcome to GNU Hell!\n"); diff --git a/tests/testsuite.at b/tests/testsuite.at index 486d111fe..ad97009d3 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -179,7 +179,7 @@ AT_DATA([main.c], #include "ltdl.h" int -main (int argc, char **argv) +main () { lt_dlhandle module; const char *(*func) (void) = 0;