This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/82130] New: stringification (#) in traditional mode
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Sep 2017 10:59:48 +0000
- Subject: [Bug preprocessor/82130] New: stringification (#) in traditional mode
- Auto-submitted: auto-generated
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?