This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libgomp.c/ cleanup
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 6 Oct 2014 13:53:16 +0200
- Subject: Re: [PATCH] libgomp.c/ cleanup
- Authentication-results: sourceware.org; auth=none
- References: <20141006101833 dot GQ3503 at redhat dot com> <20141006104651 dot GY1986 at tucnak dot redhat dot com>
On Mon, Oct 06, 2014 at 12:46:51PM +0200, Jakub Jelinek wrote:
> On Mon, Oct 06, 2014 at 12:18:33PM +0200, Marek Polacek wrote:
> > --- gcc/libgomp/testsuite/libgomp.c/affinity-1.c
> > +++ gcc/libgomp/testsuite/libgomp.c/affinity-1.c
> > @@ -31,6 +31,7 @@
> >
> > #ifdef DO_FORK
> > #include <signal.h>
> > +pid_t waitpid (pid_t, int *, int);
>
> I'd #include <sys/wait.h> here instead.
>
> > --- gcc/libgomp/testsuite/libgomp.c/nqueens-1.c
> > +++ gcc/libgomp/testsuite/libgomp.c/nqueens-1.c
> > @@ -6,6 +6,7 @@
> > #include <stdio.h>
> > #include <string.h>
> >
> > +unsigned long int strtoul(const char *, char **, int);
>
> and #include <stdlib.h> here.
>
> > --- gcc/libgomp/testsuite/libgomp.c/thread-limit-1.c
> > +++ gcc/libgomp/testsuite/libgomp.c/thread-limit-1.c
> > @@ -4,6 +4,11 @@
> > #include <stdlib.h>
> > #include <unistd.h>
> >
> > +extern int omp_get_thread_limit (void);
> > +extern int omp_set_dynamic (int);
> > +extern void omp_set_nested (int);
> > +extern int omp_get_num_threads (void);
> > +
> > int
> > main ()
> > {
> > diff --git gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c
> > index 0fc9dae..ca9ad23 100644
> > --- gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c
> > +++ gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c
> > @@ -4,6 +4,11 @@
> > #include <stdlib.h>
> > #include <unistd.h>
> >
> > +extern int omp_get_thread_limit (void);
> > +extern int omp_set_dynamic (int);
> > +extern void omp_set_nested (int);
> > +extern int omp_get_num_threads (void);
>
> Please #include <omp.h> in the above two tests instead.
Ok, sorry. I'm fixing those with the following.
Applying to trunk.
2014-10-06 Marek Polacek <polacek@redhat.com>
* testsuite/libgomp.c/affinity-1.c: Include <sys/wait.h>.
* testsuite/libgomp.c/nqueens-1.c: Include <stdlib.h>.
* testsuite/libgomp.c/thread-limit-1.c: Include <omp.h>
* testsuite/libgomp.c/thread-limit-2.c: Likewise.
diff --git gcc/libgomp/testsuite/libgomp.c/affinity-1.c gcc/libgomp/testsuite/libgomp.c/affinity-1.c
index a1a2a12..21f344c 100644
--- gcc/libgomp/testsuite/libgomp.c/affinity-1.c
+++ gcc/libgomp/testsuite/libgomp.c/affinity-1.c
@@ -31,7 +31,7 @@
#ifdef DO_FORK
#include <signal.h>
-pid_t waitpid (pid_t, int *, int);
+#include <sys/wait.h>
#endif
#ifdef HAVE_PTHREAD_AFFINITY_NP
#include <sched.h>
diff --git gcc/libgomp/testsuite/libgomp.c/nqueens-1.c gcc/libgomp/testsuite/libgomp.c/nqueens-1.c
index ed6c179..9742b7a 100644
--- gcc/libgomp/testsuite/libgomp.c/nqueens-1.c
+++ gcc/libgomp/testsuite/libgomp.c/nqueens-1.c
@@ -5,8 +5,8 @@
#include <omp.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
-unsigned long int strtoul(const char *, char **, int);
int cnt;
#pragma omp threadprivate (cnt)
diff --git gcc/libgomp/testsuite/libgomp.c/thread-limit-1.c gcc/libgomp/testsuite/libgomp.c/thread-limit-1.c
index 7571f23..1d9794a 100644
--- gcc/libgomp/testsuite/libgomp.c/thread-limit-1.c
+++ gcc/libgomp/testsuite/libgomp.c/thread-limit-1.c
@@ -3,11 +3,7 @@
#include <stdlib.h>
#include <unistd.h>
-
-extern int omp_get_thread_limit (void);
-extern int omp_set_dynamic (int);
-extern void omp_set_nested (int);
-extern int omp_get_num_threads (void);
+#include <omp.h>
int
main ()
diff --git gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c
index ca9ad23..1a97fb6 100644
--- gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c
+++ gcc/libgomp/testsuite/libgomp.c/thread-limit-2.c
@@ -3,11 +3,7 @@
#include <stdlib.h>
#include <unistd.h>
-
-extern int omp_get_thread_limit (void);
-extern int omp_set_dynamic (int);
-extern void omp_set_nested (int);
-extern int omp_get_num_threads (void);
+#include <omp.h>
int
main ()
Marek