Re: g77 inconsistency?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christos Tountas wrote:

Hello,

"Ugly" initialization of numeric variables with text strings seems
to work for some types of numeric variables only.

The following works:
    integer i
    data i /'abcd'/

But this does not:
    real*8 r
    data r /'abcdefgh'/

More than a dozen compilers  on different platforms over the years
have done this correctly. Cannot get g77 to do it with
any combination of options. I have a lot of old code that needs it.
Any hope?

The following works (due to the fact that holleriths are used in stead of plain constant strings):


      integer i
      data i /'abcd'/
      real r
      data r /4habcd/
      real*8 d
      data d /8habcdefgh/
      print*,i
      print*,r
      print*,d
      end

Note that development on g77 has stopped. New development is only going on with gfortran (see: http://gcc.gnu.org/fortran).

Kind regards,

--
Toon Moene - e-mail: toon@xxxxxxxxxxxxxxxxxxxx - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux