From patchwork Sun Jan 25 15:55:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 4801 Received: (qmail 17165 invoked by alias); 25 Jan 2015 15:55:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17140 invoked by uid 89); 25 Jan 2015 15:55:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, SPF_PASS autolearn=ham version=3.3.2 X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 25 Jan 2015 15:55:32 +0000 From: Mark Wielaard To: gdb-patches@sourceware.org Cc: Mark Wielaard Subject: [PATCH] Remove testsuite compile errors with GCC5. Date: Sun, 25 Jan 2015 16:55:21 +0100 Message-Id: <1422201321-19224-1-git-send-email-mjw@redhat.com> X-Spam-Score: -2.9 (--) GCC5 defaults to the GNU11 standard for C and warns by default for implicit function declarations and implicit return types. https://gcc.gnu.org/gcc-5/porting_to.html Fixing these issues in the testsuite turns 9 untested and 17 unsupported testcases into 417 new passes when compiling with GCC5. gdb/testsuite/ChangeLog: * gdb.arch/i386-bp_permanent.c (standard): New declaration. * gdb.base/disp-step-fork.c: Include unistd.h. * gdb.base/siginfo-obj.c: Include stdio.h. * gdb.base/siginfo-thread.c: Likewise. * gdb.mi/non-stop.c: Include unistd.h. * gdb.mi/nsthrexec.c: Include stdio.h. * gdb.mi/pthreads.c: Include unistd.h. * gdb.modula2/unbounded1.c (main): Declare returns int. * gdb.reverse/consecutive-reverse.c: Likewise. * gdb.threads/create-fail.c: Include unistd.h. * gdb.threads/killed.c: Likewise. * gdb.threads/linux-dp.c: Likewise. * gdb.threads/non-ldr-exc-1.c: Include stdio.h and string.h. * gdb.threads/non-ldr-exc-2.c: Likewise. * gdb.threads/non-ldr-exc-3.c: Likewise. * gdb.threads/non-ldr-exc-4.c: Likewise. * gdb.threads/pthreads.c: Include unistd.h. (main): Declare returns int. * gdb.threads/tls-main.c (foo): New declaration. * gdb.threads/watchpoint-fork-mt.c: Define _GNU_SOURCE. OK to push? diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.c b/gdb/testsuite/gdb.arch/i386-bp_permanent.c index a77ca51..0862d84 100644 --- a/gdb/testsuite/gdb.arch/i386-bp_permanent.c +++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.c @@ -21,6 +21,8 @@ #define SYMBOL(str) #str #endif +void standard (void); + int main (void) { diff --git a/gdb/testsuite/gdb.base/disp-step-fork.c b/gdb/testsuite/gdb.base/disp-step-fork.c index 13a98c4..b01030f 100644 --- a/gdb/testsuite/gdb.base/disp-step-fork.c +++ b/gdb/testsuite/gdb.base/disp-step-fork.c @@ -16,6 +16,7 @@ along with this program. If not, see . */ #include +#include static void marker () {} diff --git a/gdb/testsuite/gdb.base/siginfo-obj.c b/gdb/testsuite/gdb.base/siginfo-obj.c index a55e21f..f98c646 100644 --- a/gdb/testsuite/gdb.base/siginfo-obj.c +++ b/gdb/testsuite/gdb.base/siginfo-obj.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/gdb/testsuite/gdb.base/siginfo-thread.c b/gdb/testsuite/gdb.base/siginfo-thread.c index 7927980..845d3a0 100644 --- a/gdb/testsuite/gdb.base/siginfo-thread.c +++ b/gdb/testsuite/gdb.base/siginfo-thread.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/gdb/testsuite/gdb.mi/non-stop.c b/gdb/testsuite/gdb.mi/non-stop.c index ef62374..5acfefa 100644 --- a/gdb/testsuite/gdb.mi/non-stop.c +++ b/gdb/testsuite/gdb.mi/non-stop.c @@ -19,6 +19,7 @@ #include #include #include +#include /* Under HPUX 10, the second arg of pthread_create is prototyped to be just a "pthread_attr_t", while under Solaris it diff --git a/gdb/testsuite/gdb.mi/nsthrexec.c b/gdb/testsuite/gdb.mi/nsthrexec.c index 00e779f..ee001b4 100644 --- a/gdb/testsuite/gdb.mi/nsthrexec.c +++ b/gdb/testsuite/gdb.mi/nsthrexec.c @@ -18,6 +18,7 @@ #include #include #include +#include static const char *image; diff --git a/gdb/testsuite/gdb.mi/pthreads.c b/gdb/testsuite/gdb.mi/pthreads.c index ca62664..70fd521 100644 --- a/gdb/testsuite/gdb.mi/pthreads.c +++ b/gdb/testsuite/gdb.mi/pthreads.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Under HPUX 10, the second arg of pthread_create is prototyped to be just a "pthread_attr_t", while under Solaris it diff --git a/gdb/testsuite/gdb.modula2/unbounded1.c b/gdb/testsuite/gdb.modula2/unbounded1.c index af71e8d..02d9852 100644 --- a/gdb/testsuite/gdb.modula2/unbounded1.c +++ b/gdb/testsuite/gdb.modula2/unbounded1.c @@ -30,7 +30,7 @@ foo (unbounded a) return 1; } - +int main () { unbounded t; diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.c b/gdb/testsuite/gdb.reverse/consecutive-reverse.c index 342b76a..dbf956b 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-reverse.c +++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.c @@ -27,6 +27,7 @@ int foo () return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6]; } +int main() { foo (); diff --git a/gdb/testsuite/gdb.threads/create-fail.c b/gdb/testsuite/gdb.threads/create-fail.c index d754e93..ac90a96 100644 --- a/gdb/testsuite/gdb.threads/create-fail.c +++ b/gdb/testsuite/gdb.threads/create-fail.c @@ -27,6 +27,7 @@ #include #include #include +#include /* Count the number of tasks/threads in the PID thread group. */ diff --git a/gdb/testsuite/gdb.threads/killed.c b/gdb/testsuite/gdb.threads/killed.c index d42e205..59b93c4 100644 --- a/gdb/testsuite/gdb.threads/killed.c +++ b/gdb/testsuite/gdb.threads/killed.c @@ -20,6 +20,7 @@ #include #include #include +#include int pid; diff --git a/gdb/testsuite/gdb.threads/linux-dp.c b/gdb/testsuite/gdb.threads/linux-dp.c index a57938d..6458920 100644 --- a/gdb/testsuite/gdb.threads/linux-dp.c +++ b/gdb/testsuite/gdb.threads/linux-dp.c @@ -11,6 +11,7 @@ #include #include #include +#include /* The number of philosophers at the table. */ int num_philosophers; diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-1.c b/gdb/testsuite/gdb.threads/non-ldr-exc-1.c index ed86647..ea5d94d 100644 --- a/gdb/testsuite/gdb.threads/non-ldr-exc-1.c +++ b/gdb/testsuite/gdb.threads/non-ldr-exc-1.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include static const char *image; diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-2.c b/gdb/testsuite/gdb.threads/non-ldr-exc-2.c index bd6b1be..e65c685 100644 --- a/gdb/testsuite/gdb.threads/non-ldr-exc-2.c +++ b/gdb/testsuite/gdb.threads/non-ldr-exc-2.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include static const char *image; diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-3.c b/gdb/testsuite/gdb.threads/non-ldr-exc-3.c index 3414c89..cc64889 100644 --- a/gdb/testsuite/gdb.threads/non-ldr-exc-3.c +++ b/gdb/testsuite/gdb.threads/non-ldr-exc-3.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include static const char *image; diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-4.c b/gdb/testsuite/gdb.threads/non-ldr-exc-4.c index a820cf7..8a98aec4 100644 --- a/gdb/testsuite/gdb.threads/non-ldr-exc-4.c +++ b/gdb/testsuite/gdb.threads/non-ldr-exc-4.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include static const char *image; diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.c b/gdb/testsuite/gdb.threads/pthread_cond_wait.c index 2b7a865..c77dc13 100644 --- a/gdb/testsuite/gdb.threads/pthread_cond_wait.c +++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.c @@ -20,6 +20,7 @@ #include #include #include +#include void cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut) diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c index 0b22015..1ad521f 100644 --- a/gdb/testsuite/gdb.threads/pthreads.c +++ b/gdb/testsuite/gdb.threads/pthreads.c @@ -22,6 +22,7 @@ #include #include #include +#include /* Under HPUX 10, the second arg of pthread_create is prototyped to be just a "pthread_attr_t", while under Solaris it @@ -110,6 +111,7 @@ foo (a, b, c) if (verbose) printf("a=%d\n", a); } +int main(argc, argv) int argc; char **argv; diff --git a/gdb/testsuite/gdb.threads/tls-main.c b/gdb/testsuite/gdb.threads/tls-main.c index eec5d50..56675e9 100644 --- a/gdb/testsuite/gdb.threads/tls-main.c +++ b/gdb/testsuite/gdb.threads/tls-main.c @@ -1,3 +1,4 @@ +int foo (void); __thread int i_tls = 2; int main () { diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c index a212e4d..36a8b45 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c +++ b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c @@ -22,6 +22,9 @@ #include #include #include + +/* pthread_yield is a GNU extension. */ +#define _GNU_SOURCE #include #include