public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28662] New: fpp call of gfortran: -traditional-cpp versus newer macros like #x
@ 2006-08-09 14:04 tobias dot burnus at physik dot fu-berlin dot de
2006-08-09 18:03 ` [Bug fortran/28662] " pinskia at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 13+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-08-09 14:04 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
@ 2006-08-09 18:03 ` pinskia at gcc dot gnu dot org
2006-08-09 18:10 ` tobias dot burnus at physik dot fu-berlin dot de
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-09 18:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-08-09 18:03 -------
One problem without using -tranditional-cpp is that some tokens in C are not
tokens in Fortran so you could get the wrong result. This is why
-tranditional-cpp is used.
There is no standard for Preprocessed Fortran Source at all.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
2006-08-09 18:03 ` [Bug fortran/28662] " pinskia at gcc dot gnu dot org
@ 2006-08-09 18:10 ` tobias dot burnus at physik dot fu-berlin dot de
2006-10-31 13:03 ` burnus at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-08-09 18:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from tobias dot burnus at physik dot fu-berlin dot de 2006-08-09 18:10 -------
> One problem without using -tranditional-cpp is that some tokens in C are not
> tokens in Fortran so you could get the wrong result. This is why
> -tranditional-cpp is used.
I though the -lang-fortran, which is passed (according to gfortran -###), takes
care of this?
> There is no standard for Preprocessed Fortran Source at all.
Well, that I assumed. But it is still (somehow) based on ISO C's preprocessor.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
2006-08-09 18:03 ` [Bug fortran/28662] " pinskia at gcc dot gnu dot org
2006-08-09 18:10 ` tobias dot burnus at physik dot fu-berlin dot de
@ 2006-10-31 13:03 ` burnus at gcc dot gnu dot org
2008-02-08 17:55 ` burnus at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-10-31 13:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2006-10-31 13:03 -------
Confirm my bug. See also 29671 ("#" must be in the first column).
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-10-31 13:03:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
` (2 preceding siblings ...)
2006-10-31 13:03 ` burnus at gcc dot gnu dot org
@ 2008-02-08 17:55 ` burnus at gcc dot gnu dot org
2008-04-23 19:30 ` burnus at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-02-08 17:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2008-02-08 17:54 -------
One big problem which prevents omitting the -traditional-cpp is that comments
are not ignored. Another example of this is
! .... /*
which is regarded as the beginning of a C/C++ comment. Thus we should add two
modes to CPP, one for fixed-form and one for free-form Fortran code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
` (3 preceding siblings ...)
2008-02-08 17:55 ` burnus at gcc dot gnu dot org
@ 2008-04-23 19:30 ` burnus at gcc dot gnu dot org
2008-07-30 18:08 ` burnus at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-04-23 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from burnus at gcc dot gnu dot org 2008-04-23 19:29 -------
Additional point, one needs to take care also of continuation lines of the
following kind. This should print "Hello Paul" and not "Hello Hans".
#define Paul Hans
! Paul's string
print *,'Hello &
&Paul'
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
` (4 preceding siblings ...)
2008-04-23 19:30 ` burnus at gcc dot gnu dot org
@ 2008-07-30 18:08 ` burnus at gcc dot gnu dot org
2008-08-06 6:25 ` burnus at gcc dot gnu dot org
2008-08-06 6:27 ` burnus at gcc dot gnu dot org
7 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-07-30 18:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from burnus at gcc dot gnu dot org 2008-07-30 18:06 -------
For an initial, incomplete patch see:
http://gcc.gnu.org/ml/fortran/2008-07/msg00248.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
` (5 preceding siblings ...)
2008-07-30 18:08 ` burnus at gcc dot gnu dot org
@ 2008-08-06 6:25 ` burnus at gcc dot gnu dot org
2008-08-06 6:27 ` burnus at gcc dot gnu dot org
7 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-08-06 6:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from burnus at gcc dot gnu dot org 2008-08-06 06:24 -------
> For an initial, incomplete patch see:
> http://gcc.gnu.org/ml/fortran/2008-07/msg00248.html
Slighly updated version. Set tradtional to 0 in fortran/cpp.c to enable new
features, which will fail if the following (work items) are in you Fortran
file:
- Spacing needs to be preserved for fixed-form Fortran
(currently fails in the test suite)
- Check that '...''...' work (seems so)
- Problem mentioned in comment 5
* Max linelength option for gfortran and cpp
* Fortran/Fixed-form-source Fortran for cpp
* Should one use c_lang instead of a flag? Advantage for c_lang: Fortran is a
language; advantage for flag: the CPP features can be tuned by c_lang.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
2006-08-09 14:04 [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
` (6 preceding siblings ...)
2008-08-06 6:25 ` burnus at gcc dot gnu dot org
@ 2008-08-06 6:27 ` burnus at gcc dot gnu dot org
7 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-08-06 6:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from burnus at gcc dot gnu dot org 2008-08-06 06:25 -------
Created an attachment (id=16029)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16029&action=view)
libcpp patch (w/o setting traditional = 0 )
Said patch, see comment 7 for TODO items.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
[not found] <bug-28662-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2015-08-30 14:37 ` dominiq at lps dot ens.fr
@ 2021-08-27 2:15 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-27 2:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
Bug 28662 depends on bug 67623, which changed state.
Bug 67623 Summary: interaction between cpp and Fortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67623
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
[not found] <bug-28662-4@http.gcc.gnu.org/bugzilla/>
2012-03-03 14:37 ` fxcoudert at gcc dot gnu.org
2014-12-11 16:21 ` burnus at gcc dot gnu.org
@ 2015-08-30 14:37 ` dominiq at lps dot ens.fr
2021-08-27 2:15 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-08-30 14:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |valeryweber at hotmail dot com
--- Comment #12 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
*** Bug 63413 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
[not found] <bug-28662-4@http.gcc.gnu.org/bugzilla/>
2012-03-03 14:37 ` fxcoudert at gcc dot gnu.org
@ 2014-12-11 16:21 ` burnus at gcc dot gnu.org
2015-08-30 14:37 ` dominiq at lps dot ens.fr
2021-08-27 2:15 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-12-11 16:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Related: All source-file reading should go though libcpp, which requires a
better white space handling; cf.
https://gcc.gnu.org/ml/fortran/2014-12/msg00003.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/28662] fpp call of gfortran: -traditional-cpp versus newer macros like #x
[not found] <bug-28662-4@http.gcc.gnu.org/bugzilla/>
@ 2012-03-03 14:37 ` fxcoudert at gcc dot gnu.org
2014-12-11 16:21 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2012-03-03 14:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662
Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |franke.daniel at gmail dot
| |com
--- Comment #9 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> 2012-03-03 14:36:27 UTC ---
*** Bug 29671 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-08-27 2:15 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-09 14:04 [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
2006-08-09 18:03 ` [Bug fortran/28662] " pinskia at gcc dot gnu dot org
2006-08-09 18:10 ` tobias dot burnus at physik dot fu-berlin dot de
2006-10-31 13:03 ` burnus at gcc dot gnu dot org
2008-02-08 17:55 ` burnus at gcc dot gnu dot org
2008-04-23 19:30 ` burnus at gcc dot gnu dot org
2008-07-30 18:08 ` burnus at gcc dot gnu dot org
2008-08-06 6:25 ` burnus at gcc dot gnu dot org
2008-08-06 6:27 ` burnus at gcc dot gnu dot org
[not found] <bug-28662-4@http.gcc.gnu.org/bugzilla/>
2012-03-03 14:37 ` fxcoudert at gcc dot gnu.org
2014-12-11 16:21 ` burnus at gcc dot gnu.org
2015-08-30 14:37 ` dominiq at lps dot ens.fr
2021-08-27 2:15 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).