Remove testsuite compile errors with GCC5.
authorMark Wielaard <mjw@redhat.com>
Sun, 25 Jan 2015 15:42:05 +0000 (16:42 +0100)
committerMark Wielaard <mjw@redhat.com>
Sun, 25 Jan 2015 17:50:56 +0000 (18:50 +0100)
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.

21 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/i386-bp_permanent.c
gdb/testsuite/gdb.base/disp-step-fork.c
gdb/testsuite/gdb.base/siginfo-obj.c
gdb/testsuite/gdb.base/siginfo-thread.c
gdb/testsuite/gdb.mi/non-stop.c
gdb/testsuite/gdb.mi/nsthrexec.c
gdb/testsuite/gdb.mi/pthreads.c
gdb/testsuite/gdb.modula2/unbounded1.c
gdb/testsuite/gdb.reverse/consecutive-reverse.c
gdb/testsuite/gdb.threads/create-fail.c
gdb/testsuite/gdb.threads/killed.c
gdb/testsuite/gdb.threads/linux-dp.c
gdb/testsuite/gdb.threads/non-ldr-exc-1.c
gdb/testsuite/gdb.threads/non-ldr-exc-2.c
gdb/testsuite/gdb.threads/non-ldr-exc-3.c
gdb/testsuite/gdb.threads/non-ldr-exc-4.c
gdb/testsuite/gdb.threads/pthread_cond_wait.c
gdb/testsuite/gdb.threads/pthreads.c
gdb/testsuite/gdb.threads/tls-main.c
gdb/testsuite/gdb.threads/watchpoint-fork-mt.c

index ba387eff57152ebb53cfdbb1921ba66704e905ba..68225825442fd0c64de3c5d4746022dcbed2d9da 100644 (file)
@@ -1,3 +1,26 @@
+2015-01-25  Mark Wielaard  <mjw@redhat.com>
+
+       * 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.
+
 2015-01-23  Simon Marchi  <simon.marchi@ericsson.com>
 
        * gdb.mi/mi-var-list-children-invalid-grandchild.c: New file.
index a77ca51ad21e14d19cedd1cd33c2386e0f8c26c7..0862d84a36368f64e92a17b097ceecbf74be3a26 100644 (file)
@@ -21,6 +21,8 @@
 #define SYMBOL(str)    #str
 #endif
 
+void standard (void);
+
 int
 main (void)
 {
index 13a98c46576f362170812d3655f641f7a2360964..b01030fda8fc70ad73c396f47ca0dfe688465b21 100644 (file)
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <unistd.h>
 
 static void
 marker () {}
index a55e21fa4abad0c37c4f239a7c2cffcb7c67f1e2..f98c6469e8975c2ae5b2802172ad043b494b3d49 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <signal.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <sys/mman.h>
 #include <unistd.h>
index 79279806c69cfe9293581fd079c4264c162661a1..845d3a04c9f7338c56469953d70e8f8b26f5db60 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <signal.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <sys/mman.h>
 #include <unistd.h>
index ef62374850c37e4e406d08e86ea09951b44467c6..5acfefab696272ed7accfb7b44d4f27372cdc829 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
+#include <unistd.h>
 
 /* Under HPUX 10, the second arg of pthread_create
    is prototyped to be just a "pthread_attr_t", while under Solaris it
index 00e779f7425dd0895388ca2c1e3690d6549a2a2a..ee001b4c61cb5ba9d216ee6a70df276a9f68016f 100644 (file)
@@ -18,6 +18,7 @@
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 static const char *image;
 
index ca626647abf972dc55fd42ac01dc74e113e5e9f1..70fd521605db242d19926da67c034bef87753ea2 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
+#include <unistd.h>
 
 /* Under HPUX 10, the second arg of pthread_create
    is prototyped to be just a "pthread_attr_t", while under Solaris it
index af71e8dbe5b10357b5f6aff86836ada47568bcbf..02d9852629b6a7434dd34f526837ab99ba285f2c 100644 (file)
@@ -30,7 +30,7 @@ foo (unbounded a)
     return 1;
 }
 
-
+int
 main ()
 {
   unbounded t;
index 342b76a661455a08c338a0093fa52ad57682b4e7..dbf956b6750beb8a151380759316eeaede240b82 100644 (file)
@@ -27,6 +27,7 @@ int foo ()
   return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6];
 }
 
+int
 main()
 {
   foo ();
index d754e930afc0594ed478c1e63ff31d05cd100f6f..ac90a9645b128ebb6a3a2ce8b1e6c2f7abdf36d6 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <dirent.h>
 #include <assert.h>
+#include <unistd.h>
 
 /* Count the number of tasks/threads in the PID thread group.  */
 
index d42e205e0c2c0a7dd85e83ca52cc8cccde8a9b64..59b93c448ec56f548fb8d655fbd0dd0420520836 100644 (file)
@@ -20,6 +20,7 @@
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 int pid;
 
index a57938d1886cdaa38a91e373a18655569f8ecdc5..6458920aa6e957f19fffff2b54993c20702c0676 100644 (file)
@@ -11,6 +11,7 @@
 #include <pthread.h>
 #include <sys/time.h>
 #include <sys/types.h>
+#include <unistd.h>
 
 /* The number of philosophers at the table.  */
 int num_philosophers;
index ed8664789294d21576d4ad9de58f86e52c6b1ebf..ea5d94da49a839c7a9e110f6eea4969968b10f6f 100644 (file)
@@ -18,6 +18,8 @@
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 #include <assert.h>
 
 static const char *image;
index bd6b1bece7c0c10824f9151e0c6c67bcb37b2e8b..e65c685a1c47df96dbeb15437b45b2b7caffa37b 100644 (file)
@@ -18,6 +18,8 @@
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 #include <assert.h>
 
 static const char *image;
index 3414c89c42436edf81db95ed1ca3371cb400b76c..cc648898ee4a8f8bd89f8f168e04ab255b7a21db 100644 (file)
@@ -18,6 +18,8 @@
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 #include <assert.h>
 
 static const char *image;
index a820cf7be139fec647ef6bfb351727fd050f8f4c..8a98aec4ea780397de5c965e8fc2499ec122bbf8 100644 (file)
@@ -18,6 +18,8 @@
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 #include <assert.h>
 
 static const char *image;
index 2b7a865d0d49f8d64ab72309664db28e68f309cd..c77dc13f37fab897fc3321d14c223b4c5f83f13d 100644 (file)
@@ -20,6 +20,7 @@
 #include <pthread.h>
 #include <stdio.h>
 #include <time.h>
+#include <unistd.h>
 
 void
 cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut)
index 0b2201544cef4e99c1344784fafc2a8262e22575..1ad521f0f74d692febc7caaefe3b6cef17d234be 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
+#include <unistd.h>
 
 /* 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;
index eec5d50bcf49753bcee8c1862546e5237b02d82b..56675e9cd45e3d3fa664bde4af0c859210a44f92 100644 (file)
@@ -1,3 +1,4 @@
+int foo (void);
 __thread int i_tls = 2;
 int main ()
 {
index a212e4d86d6ddf635ba7aa8055dfe09fd760d951..36a8b450063bd2bcf9334c725398b1672a7c3203 100644 (file)
@@ -22,6 +22,9 @@
 #include <sys/wait.h>
 #include <stdio.h>
 #include <stdlib.h>
+
+/* pthread_yield is a GNU extension.  */
+#define _GNU_SOURCE
 #include <pthread.h>
 
 #include <asm/unistd.h>