This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp 4.0] Handle OMP_DISPLAY_ENV


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]