How to make c++ realize empty character constant ''?

Gmail yangzf01 at gmail.com
Sun Dec 8 10:35:00 PST 2013


Hi all
I am trying to compile the following statements using CPP. 

  IF ( denominator > 0 ) THEN
    IF ( mod( numerator, denominator ) /= 0 ) THEN
      IF ( numerator > 0 ) THEN
        WRITE(frac_str,FMT="('+',I2.2,'/',I2.2)") abs(numerator), denominator
      ELSE   ! numerator < 0
        WRITE(frac_str,FMT="('-',I2.2,'/',I2.2)") abs(numerator), denominator
      ENDIF
    ELSE   ! includes numerator == 0 case
      frac_str = ''
    ENDIF
  ELSE   ! no-fraction case
    frac_str = ''
  ENDIF

However the error is here

cpp -C -P -xassembler-with-cpp -I/Users/bruce/Documents/A/model/WRFChem/WRFChem3_5_1/WRFV3/inc -I. -DEM_CORE=1 -DNMM_CORE=0 -DNMM_MAX_DIM=2600 -DCOAMPS_CORE=0 -DDA_CORE=0 -DEXP_CORE=0 -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=4 -DLWORDSIZE=4 -DNONSTANDARD_SYSTEM_SUBR -DMACOS -DWRF_USE_CLM -DNO_IEEE_MODULE  -DDM_PARALLEL -DNETCDF -DUSE_ALLOCATABLES -DGRIB1 -DINTIO -DLIMIT_ARGS -DCONFIG_BUF_LEN=65536 -DMAX_DOMAINS_F=21 -DMAX_HISTORY=25 -DNMM_NEST=0 -traditional -C -P -I. Meat.b > Meat.f
Meat.b:869:18: warning: empty character constant [-Winvalid-pp-token]
      frac_str = ''
                 ^
Meat.b:872:16: warning: empty character constant [-Winvalid-pp-token]
    frac_str = ''
               ^
2 warnings generated.

Does anyone know how to make cpp can compile empty character constant?

Thanks in advance
Bruce


Thank you
Bruce


More information about the macports-users mailing list