testsuite fixes for bleeding edge gcc

Zack Weinberg zack@codesourcery.com
Thu Oct 14 07:53:00 GMT 2004


Current development versions of GCC are substantially pickier about
"built-in" library functions being properly declared, which causes a
large number of GDB testsuite failures.

The appended patch adds all the missing declarations to the 6.2-branch
version of the testsuite.  I haven't tried mainline.  Thoughts?

zw

        * gdb.base/auxv.c: Declare abort.
        * gdb.base/charset.c: Include stdlib.h.
        * gdb.base/complex.c: Declare abort and exit.
        * gdb.base/freebpcmd.c: Include stdio.h.
        * gdb.base/gcore.c: Include string.h.
        * gdb.base/sigaltstack.c: Include stdlib.h and string.h.
        * gdb.base/siginfo.c: Include string.h.
        * gdb.base/sigstep.c: Include string.h.
        * gdb.mi/basics.c: Include stdio.h.
        * gdb.mi/gdb701.c: Declare exit.
        * gdb.mi/var-cmd.c: Declare exit/

===================================================================
Index: testsuite/gdb.base/auxv.c
--- testsuite/gdb.base/auxv.c	16 Mar 2004 21:47:03 -0000	1.1
+++ testsuite/gdb.base/auxv.c	14 Oct 2004 07:40:00 -0000
@@ -11,6 +11,7 @@
 #endif
 
 #if HAVE_ABORT
+extern void abort (void);
 #define ABORT abort()
 #else
 #define ABORT {char *invalid = 0; *invalid = 0xFF;}
===================================================================
Index: testsuite/gdb.base/charset.c
--- testsuite/gdb.base/charset.c	26 Feb 2004 17:23:23 -0000	1.3
+++ testsuite/gdb.base/charset.c	14 Oct 2004 07:40:00 -0000
@@ -22,6 +22,7 @@
    bug-gdb@gnu.org  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 
===================================================================
Index: testsuite/gdb.base/complex.c
--- testsuite/gdb.base/complex.c	29 Jun 2003 20:32:23 -0000	1.1
+++ testsuite/gdb.base/complex.c	14 Oct 2004 07:40:00 -0000
@@ -1,6 +1,9 @@
 /* Test taken from GCC.  Verify that we can print a structure containing
    a complex number.  */
 
+extern void abort (void);
+extern void exit (int);
+
 typedef __complex__ float cf;
 struct x { char c; cf f; } __attribute__ ((__packed__));
 struct unpacked_x { char c; cf f; };
===================================================================
Index: testsuite/gdb.base/freebpcmd.c
--- testsuite/gdb.base/freebpcmd.c	17 Dec 2003 21:34:51 -0000	1.2
+++ testsuite/gdb.base/freebpcmd.c	14 Oct 2004 07:40:00 -0000
@@ -18,6 +18,8 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <stdio.h>
+
 int
 main (int argc, char **argv)
 {
===================================================================
Index: testsuite/gdb.base/gcore.c
--- testsuite/gdb.base/gcore.c	9 Jan 2002 00:37:41 -0000	1.1
+++ testsuite/gdb.base/gcore.c	14 Oct 2004 07:40:00 -0000
@@ -3,6 +3,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 int extern_array[4] = {1, 2, 3, 4};
 static int static_array[4] = {5, 6, 7, 8};
===================================================================
Index: testsuite/gdb.base/long_long.c
--- testsuite/gdb.base/long_long.c	16 Jun 2004 15:19:41 -0000	1.3
+++ testsuite/gdb.base/long_long.c	14 Oct 2004 07:40:00 -0000
@@ -26,6 +26,7 @@
  *
  * cc +e +DA2.0 -g -o long_long long_long.c
  */
+#include <string.h>
 
 enum { MAX_BYTES = 16 };
 
===================================================================
Index: testsuite/gdb.base/sigaltstack.c
--- testsuite/gdb.base/sigaltstack.c	5 Apr 2004 21:00:21 -0000	1.1
+++ testsuite/gdb.base/sigaltstack.c	14 Oct 2004 07:40:00 -0000
@@ -21,6 +21,8 @@
 
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/time.h>
 
 enum level { MAIN, OUTER, INNER, LEAF, NR_LEVELS };
===================================================================
Index: testsuite/gdb.base/siginfo.c
--- testsuite/gdb.base/siginfo.c	15 Apr 2004 21:14:00 -0000	1.1
+++ testsuite/gdb.base/siginfo.c	14 Oct 2004 07:40:00 -0000
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include <signal.h>
+#include <string.h>
 #include <sys/time.h>
 
 static volatile int done;
===================================================================
Index: testsuite/gdb.base/sigstep.c
--- testsuite/gdb.base/sigstep.c	21 Apr 2004 17:19:28 -0000	1.1
+++ testsuite/gdb.base/sigstep.c	14 Oct 2004 07:40:00 -0000
@@ -19,6 +19,7 @@
 */
 
 #include <stdio.h>
+#include <string.h>
 #include <signal.h>
 #include <sys/time.h>
 
===================================================================
Index: testsuite/gdb.mi/basics.c
--- testsuite/gdb.mi/basics.c	14 Mar 2000 05:02:03 -0000	1.3
+++ testsuite/gdb.mi/basics.c	14 Oct 2004 07:40:00 -0000
@@ -2,6 +2,7 @@
  *	This simple program that passes different types of arguments
  *      on function calls.  Useful to test printing frames, stepping, etc.
  */
+#include <stdio.h>
 
 int callee4 (void)
 {
===================================================================
Index: testsuite/gdb.mi/gdb701.c
--- testsuite/gdb.mi/gdb701.c	16 Sep 2002 19:01:43 -0000	1.1
+++ testsuite/gdb.mi/gdb701.c	14 Oct 2004 07:40:00 -0000
@@ -1,3 +1,5 @@
+extern void exit(int);
+
 struct _foo
 {
   int x;
===================================================================
Index: testsuite/gdb.mi/var-cmd.c
--- testsuite/gdb.mi/var-cmd.c	23 Feb 2000 00:25:43 -0000	1.1
+++ testsuite/gdb.mi/var-cmd.c	14 Oct 2004 07:40:00 -0000
@@ -1,3 +1,5 @@
+extern void exit (int);
+
 struct _simple_struct {
   int integer;
   unsigned int unsigned_integer;



More information about the Gdb-patches mailing list