https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82130

            Bug ID: 82130
           Summary: stringification (#) in traditional mode
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

I noticed that cpp does not seem to support stringification in traditional
mode.

Simple Fortran test:


#define _ASSERT_(expr)              if (.not. (expr)) print *, #expr
program test
logical :: check = .false.
_ASSERT_(check)
end


cpp in standard mode does the expected thing, namely translate the _ASSERT_
line into:

if (.not. (check)) print *, "check"

(which is valid Fortran code). But with -traditional I get:

if (.not. (check)) print *, #check

That's a shame because it makes stringification unusable with gfortran. Is is
feasible to add support for stringification in traditional mode?

Reply via email to