NCAR / ParallelIO

A high-level Parallel I/O Library for structured grid applications
Apache License 2.0
134 stars 52 forks source link

pio_nc4.c:1341:47: error: macro "PLOG" passed 4 arguments, but takes just 1 #1987

Open j34ni opened 5 months ago

j34ni commented 5 months ago

Hi,

I am getting these errors with CESM 2.3 (alpha 17a) and pio2.6.2 when compiling in debug mode with GNU and MPIch:

/scratch/cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_nc4.c: In function 'PIOc_def_var_filter':
/scratch//cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_nc4.c:1340:9: error: 'i' undeclared (first use in this function); did you mean 'id'?
 1340 |     for(i=0; i<nparams; i++)
      |         ^
      |         id
/scratch/cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_nc4.c:1340:9: note: each undeclared identifier is reported only once for each function it appears in
/scratch/cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_nc4.c:1341:47: error: macro "PLOG" passed 4 arguments, but takes just 1
 1341 |         PLOG(1, "  param %d %d\n",i, params[i]);
      |                                               ^
In file included from /scratch/cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_nc4.c:8:
**/scratch/cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_internal.h:97: note: macro "PLOG" defined here
   **97 | #define PLOG(e) pio_log e****
      |
/scratch/cesm2_3_alpha17a/libraries/parallelio/src/clib/pio_nc4.c:1341:9: error: 'PLOG' undeclared (first use in this function)
 1341 |         PLOG(1, "  param %d %d\n",i, params[i]);

Is it normal?

jedwards4b commented 5 months ago

The PLOG macro requires two sets of parenthesis: For example line 1341 of pio_nc4.c should be PLOG((1, " param %d %d\n",i, params[i])); I've corrected this in main but haven't made a new tag yet.