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



             Bug #: 56735

           Summary: Namelist Read Error with question marks

    Classification: Unclassified

           Product: gcc

           Version: 4.6.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: madawilli...@gmail.com





Hi,



This is my first ever bug report so apologies if i miss some vital piece of

information. I have some legacy code which compiles and runs with versions of

gfortran up to 4.5. However after this the code compiles and runs but the

namelist is not read correctly. There is no IO errors but non of the variables

are set to their respective values. I have managed to narrow this down to the

fact that the legacy namelist has question marks in the namelist file outside

of any data block. Below is a very simple code and namelist which shows this.

If you remove the question mark from the name list the values are set,

otherwise they are not.



-test.f

        PROGRAM TEST



        INTEGER int1,int2,int3



        NAMELIST /temp/ int1,int2,int3



        OPEN (53,FILE='test.nam',STATUS='OLD', IOSTAT=istat)

        READ (53,temp)

        WRITE(*, temp)

        PRINT*, istat

        END PROGRAM



-test.nam

  ? 



 $temp

  int1=1

  int2=2

  int3=3

 $END



I understand this might be non standard formatting for the namelist file, but

as I said it works with gfortran <4.6 so seems like a regression.

Reply via email to