This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp 4.0] Handle OMP_DISPLAY_ENV
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Mar 2013 17:50:08 +0100
- Subject: Re: [gomp 4.0] Handle OMP_DISPLAY_ENV
- References: <51488314 dot 6090308 at net-b dot de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Mar 19, 2013 at 04:24:04PM +0100, Tobias Burnus wrote:
> 2013-03-19 Tobias Burnus <burnus@net-b.de>
>
> * env.c (handle_omp_display_env): New function.
> (initialize_env): Use it.
>
> diff --git a/libgomp/env.c b/libgomp/env.c
> index 65cbba8..e228bd9 100644
> --- a/libgomp/env.c
> +++ b/libgomp/env.c
> @@ -29,6 +29,8 @@
> #include "libgomp_f.h"
> #include <ctype.h>
> #include <stdlib.h>
> +#include <stdio.h>
> +#include <inttypes.h> /* For PRIu64. */
stdio.h is fine, but inttypes.h needs to be
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
for portability (libgomp/configure already checks for that).
Guess this then needs to be guarded with
#ifdef HAVE_INTTYPES_H
> + fprintf (stderr, " GOMP_SPINCOUNT = '%"PRIu64"'\n",
> + (uint64_t) gomp_spin_count_var);
and if not defined, use %ld with (unsigned long) cast instead.
Jakub