This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/testsuite/threads] add #include <stdlib.h>
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: gdb-patches at sources dot redhat dot com, msnyder at redhat dot com
- Date: Tue, 14 Sep 2004 16:27:47 -0400
- Subject: [patch/testsuite/threads] add #include <stdlib.h>
This patch includes <stdlib.h> in a few more files as required by the
Ansi C standard: a program must include a standard header before it can
use a standard library function. gcc HEAD issues warnings about this
now.
This is the last bit of fluff to get gdb.threads working with gcc HEAD.
The results with gcc HEAD are now as good as the results with gcc 3.4.2,
for gdb.threads.
(There's one file left in gdb.mi that I know about).
I hope gcc doesn't add any more new warnings for a while.
Tested on native i686-pc-linux-gnu with gcc 2.95.3, gcc 3.3.4,
gcc 3.4.2, and gcc HEAD 20040914, with dwarf-2 and stabs+.
I am committing this now.
2004-09-14 Michael Chastain <mec.gnu@mindspring.com>
* gdb.threads/killed.c: Include <stdlib.h>.
* gdb.threads/pthreads.c: Likewise.
Index: gdb.threads/killed.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/killed.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 killed.c
*** gdb.threads/killed.c 14 Sep 2004 15:50:03 -0000 1.2
--- gdb.threads/killed.c 14 Sep 2004 20:05:11 -0000
***************
*** 1,6 ****
/* This testcase is part of GDB, the GNU debugger.
! Copyright 2002 Free Software Foundation, Inc.
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
--- 1,6 ----
/* This testcase is part of GDB, the GNU debugger.
! Copyright 2002, 2004 Free Software Foundation, Inc.
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
***************
*** 21,26 ****
--- 21,27 ----
#include <signal.h>
#include <pthread.h>
#include <stdio.h>
+ #include <stdlib.h>
int pid;
Index: gdb.threads/pthreads.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/pthreads.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 pthreads.c
*** gdb.threads/pthreads.c 23 Oct 2003 04:43:54 -0000 1.5
--- gdb.threads/pthreads.c 14 Sep 2004 20:05:11 -0000
***************
*** 1,5 ****
/* Pthreads test program.
! Copyright 1996, 2002, 2003
Free Software Foundation, Inc.
Written by Fred Fish of Cygnus Support
--- 1,5 ----
/* Pthreads test program.
! Copyright 1996, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Fred Fish of Cygnus Support
***************
*** 23,28 ****
--- 23,29 ----
Boston, MA 02111-1307, USA. */
#include <stdio.h>
+ #include <stdlib.h>
#include <pthread.h>
/* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create