public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37032]  New: Multi-line comments in an included file trigger invalid character
@ 2008-08-05 18:52 godom at twinbee dot com
  2008-08-05 19:23 ` [Bug fortran/37032] including "file.F90" - no CPP processing burnus at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: godom at twinbee dot com @ 2008-08-05 18:52 UTC (permalink / raw)
  To: gcc-bugs

Multi-line comments in an included file trigger "invalid character in name"
compiler error.

!file1.F95
program file1
  include 'file2.F95'
  stop
end program

!file2.F95
/* blah */


-- 
           Summary: Multi-line comments in an included file trigger invalid
                    character
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: godom at twinbee dot com


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
@ 2008-08-05 19:23 ` burnus at gcc dot gnu dot org
  2008-08-05 21:09 ` godom at twinbee dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-08-05 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-08-05 19:22 -------
Cf. multiple topic PR 35707.

The problem is that
  include 'file2.F95'
is not processed through CPP. I'm not sure whether it should and when it should
(file extension .F/F90/F95/F03/F08/FPP/FOR/fpp, always, or never).

One possibility is to use:
#include "file2.F95"
in this case CPP includes the file before it hands it to the Fortran part of
the compiler.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Multi-line comments in an   |including "file.F90" - no
                   |included file trigger       |CPP processing
                   |invalid character           |


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
  2008-08-05 19:23 ` [Bug fortran/37032] including "file.F90" - no CPP processing burnus at gcc dot gnu dot org
@ 2008-08-05 21:09 ` godom at twinbee dot com
  2008-08-05 21:19 ` kargl at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: godom at twinbee dot com @ 2008-08-05 21:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from godom at twinbee dot com  2008-08-05 21:07 -------
I guess that would only work with GCC but if we can get OpenMP working, that
might be good enough.  Thank you ^_^.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
  2008-08-05 19:23 ` [Bug fortran/37032] including "file.F90" - no CPP processing burnus at gcc dot gnu dot org
  2008-08-05 21:09 ` godom at twinbee dot com
@ 2008-08-05 21:19 ` kargl at gcc dot gnu dot org
  2008-08-05 21:31 ` godom at twinbee dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-08-05 21:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kargl at gcc dot gnu dot org  2008-08-05 21:17 -------
(In reply to comment #1)
> Cf. multiple topic PR 35707.
> 
> The problem is that
>   include 'file2.F95'
> is not processed through CPP. I'm not sure whether it should and when it should
> (file extension .F/F90/F95/F03/F08/FPP/FOR/fpp, always, or never).
> 

The standard simply says the text in file2.F95 is included
at the location of the include line.  It does not and suppose
the standard will never discuss whether file2.F95 should be
pre-processed before inclusion.

This looks like pilot error in that Fortran's INCLUDE does not
mean the same thing as C's #include.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (2 preceding siblings ...)
  2008-08-05 21:19 ` kargl at gcc dot gnu dot org
@ 2008-08-05 21:31 ` godom at twinbee dot com
  2008-08-05 21:45 ` kargl at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: godom at twinbee dot com @ 2008-08-05 21:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from godom at twinbee dot com  2008-08-05 21:30 -------
(In reply to comment #3)
> (In reply to comment #1)
> > Cf. multiple topic PR 35707.
> > 
> > The problem is that
> >   include 'file2.F95'
> > is not processed through CPP. I'm not sure whether it should and when it should
> > (file extension .F/F90/F95/F03/F08/FPP/FOR/fpp, always, or never).
> > 
> 
> The standard simply says the text in file2.F95 is included
> at the location of the include line.  It does not and suppose
> the standard will never discuss whether file2.F95 should be
> pre-processed before inclusion.
> 
> This looks like pilot error in that Fortran's INCLUDE does not
> mean the same thing as C's #include.
> 

Does the Fortran standard mention preprocessing at all?  That works in g95, but
 we are beginning to move away from that.  Is a copy of the standard freely
available?  I would like for this to work with as many different compilers and
systems as possible.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (3 preceding siblings ...)
  2008-08-05 21:31 ` godom at twinbee dot com
@ 2008-08-05 21:45 ` kargl at gcc dot gnu dot org
  2008-08-05 22:06 ` godom at twinbee dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-08-05 21:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from kargl at gcc dot gnu dot org  2008-08-05 21:44 -------
(In reply to comment #4
> Does the Fortran standard mention preprocessing at all?

No.  Section 1.1 (the very 1st section) states


1.1      Scope
ISO/IEC 1539 is a multipart International Standard; the parts are published
separately. This publication, ISO/IEC 1539-1, which is the first part,
specifies the form and establishes the interpretation of programs expressed in
the base Fortran language. The purpose of this part of ISO/IEC 1539 is to
promote portability, reliability, maintainability, and efficient execution of
....
The third part, ISO/IEC 1539-3, defines a standard conditional compilation
facility for Fortran.  A processor conforming to part 1 need not conform to
ISO/IEC 1539-2 or ISO/IEC 1539-3; however, conformance to either assumes
conformance to this part.

> Is a copy of the standard freely available?

The Standard is not free.  You, however, can find drafts of the
various standards that are provided so people can provide feedback
to J3.  See the gfortran wiki for pointers to drafts.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (4 preceding siblings ...)
  2008-08-05 21:45 ` kargl at gcc dot gnu dot org
@ 2008-08-05 22:06 ` godom at twinbee dot com
  2008-08-06  6:14 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: godom at twinbee dot com @ 2008-08-05 22:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from godom at twinbee dot com  2008-08-05 22:04 -------
(In reply to comment #5)
ok.  Thank you very much for your help ^_^.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (5 preceding siblings ...)
  2008-08-05 22:06 ` godom at twinbee dot com
@ 2008-08-06  6:14 ` burnus at gcc dot gnu dot org
  2008-08-14 21:18 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-08-06  6:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from burnus at gcc dot gnu dot org  2008-08-06 06:12 -------
> Does the Fortran standard mention preprocessing at all?

Yes, part 3 of the Fortran standard is about preprocessing ("Conditional
Compilation", "CoCo"), however, to my knowledge hardly anyone uses it and no
compiler implements it. (There exists a Fortran program which can be used as
coco preprocessor, see link below.)

The de-facto standard for preprocessing is CPP (C Pre Processor) sometimes also
called FPP. However, this is only standardized for C and not for Fortran, which
causes issues as not every compiler acts the same. Issues:

1. Are newer CPP features supported?
2. Are Fortran "INCLUDE"d files also preprocessed?

gfortran/netlib's fpp/NAG f95/openf95/sunf95: (1) no,(2) no
g95:   no/yes
ifort: yes/no, 

(There are plans to support (1) in gfortran, see PR 28662.)


> Is a copy of the standard freely available?

Yes and no. The latest drafts before the standard went to ISO are available for
free, which are said to be the same except for layout. See links at
http://gcc.gnu.org/wiki/GFortranStandards

> I would like for this to work with as many different compilers and
> systems as possible.

Then I really suggest to use  #include "...", which should work with any
compiler which does CPP preprocessing.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (6 preceding siblings ...)
  2008-08-06  6:14 ` burnus at gcc dot gnu dot org
@ 2008-08-14 21:18 ` dfranke at gcc dot gnu dot org
  2008-08-18 20:48 ` dfranke at gcc dot gnu dot org
  2008-08-18 20:52 ` dfranke at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-08-14 21:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dfranke at gcc dot gnu dot org  2008-08-14 21:17 -------
IMO, not pre-processing INCLUDEd files (as opposed to #include'd ones) is a
feature, not a bug. 

Maybe we should make a final decision on this, i.e. if bug or feature, and
state/document it, once and for all?


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (7 preceding siblings ...)
  2008-08-14 21:18 ` dfranke at gcc dot gnu dot org
@ 2008-08-18 20:48 ` dfranke at gcc dot gnu dot org
  2008-08-18 20:52 ` dfranke at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-08-18 20:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dfranke at gcc dot gnu dot org  2008-08-18 20:47 -------
Subject: Bug 37032

Author: dfranke
Date: Mon Aug 18 20:46:08 2008
New Revision: 139215

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139215
Log:
2008-08-18  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/37032
        * gfortran.texi: Document decision on include file handling in
        preprocessed files.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.texi


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/37032] including "file.F90" - no CPP processing
  2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
                   ` (8 preceding siblings ...)
  2008-08-18 20:48 ` dfranke at gcc dot gnu dot org
@ 2008-08-18 20:52 ` dfranke at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-08-18 20:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dfranke at gcc dot gnu dot org  2008-08-18 20:51 -------
Closing as WONTFIX.

Reference:
    http://gcc.gnu.org/ml/fortran/2008-08/msg00071.html
(and following).

(Updated) Documentation about gfortran's behaviour with preprocessing can be
found in sections 1.3 and 2.3 of the manual
(http://gcc.gnu.org/onlinedocs/gfortran/).


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX
   Target Milestone|---                         |4.4.0


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-08-18 20:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-05 18:52 [Bug fortran/37032] New: Multi-line comments in an included file trigger invalid character godom at twinbee dot com
2008-08-05 19:23 ` [Bug fortran/37032] including "file.F90" - no CPP processing burnus at gcc dot gnu dot org
2008-08-05 21:09 ` godom at twinbee dot com
2008-08-05 21:19 ` kargl at gcc dot gnu dot org
2008-08-05 21:31 ` godom at twinbee dot com
2008-08-05 21:45 ` kargl at gcc dot gnu dot org
2008-08-05 22:06 ` godom at twinbee dot com
2008-08-06  6:14 ` burnus at gcc dot gnu dot org
2008-08-14 21:18 ` dfranke at gcc dot gnu dot org
2008-08-18 20:48 ` dfranke at gcc dot gnu dot org
2008-08-18 20:52 ` dfranke at gcc dot gnu dot 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).