This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: Not initialising without :: Bug?



On 01/11/2012 01:02 AM, Steve Kargl wrote:
On Wed, Jan 11, 2012 at 12:51:13AM +0600, Eugene Bakin wrote:
Hello.

I'm uncertain, if it is a bug, or not.

This test program:

 PROGRAM  test
     INTEGER  i,j
 END  PROGRAM  test

causes error:

gfortran--free-form -std="f2003" for.for

            INTEGER i,j
                                                                          1
 Error:  Unexpected data declaration statement at(1)

Works for me with 4.7.0 and 4.6.3 on x86_64-*-freebsd.

 Are there any odd characters in the source code (ie.,
 tabs, carrier returns, etc)?
No. Spaces only. Tried it one more time.

PROGRAM test
   IMPLICIT NONE
   INTEGER c = 0
   PRINT *,c
END PROGRAM test

And got this:

gfortran --free-form for.for
for.for:3.12:

   INTEGER c = 0
            1
Error: Syntax error in data declaration at (1)
for.for:4.12:

   PRINT *,c
            1
Error: Symbol 'c' at (1) has no IMPLICIT type

Add IMPLICIT NONE to your code.

 troutmask:sgk[222] gfc46 -o z -std=f2003 -Wall foo.for
 foo.for:4.16:

        print *, c
                  1
 Error: Symbol 'c' at (1) has no IMPLICIT type
 foo.for:3.16:

        INTEGER  c=0
                  1
 Error: Symbol 'integerc' at (1) has no IMPLICIT type


Ok. -- Eugene Bakin zxlmm@ya.ru


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