This is the mail archive of the gcc-bugs@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]

[Bug preprocessor/82130] New: stringification (#) in traditional mode


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?

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