[Bug fortran/28662] New: fpp call of gfortran: -traditional-cpp versus newer macros like #x

tobias dot burnus at physik dot fu-berlin dot de gcc-bugzilla@gcc.gnu.org
Wed Aug 9 14:04:00 GMT 2006


See http://gcc.gnu.org/ml/fortran/2006-08/msg00145.html

Currently gfortran calls cpp with the option -traditional-cpp. Using this
option, newer macros like
   #define msg(x) print *, #x
don't work (the #x causes the argument to be quoted). (See url/email for
example.)

I couldn't find any standard for fpp. I assume that it is only a Fortran-aware
CPP, which is defined in the C99 standard (ISO/IEC 9899:1999, section "6.10.3.2
The # operator").

I would expect that the newer constructs work by default with gfortran, or at
least that one can force that mode. The first would simply mean to remove
"-traditional-cpp" from the argument list.

Other compilers: Sun Studio f95 and Intel Fortran Compiler both support #x by
default.

g95 and NAGware f95 seem to work as gfortran: msg(test) is converted into
  print *,#hello


-- 
           Summary: fpp call of gfortran: -traditional-cpp versus newer
                    macros like #x
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662



More information about the Gcc-bugs mailing list