Re: gcc: why is "abcdef"[3] not a constant (error: initializer element is not constant)

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

 



On 05/08/2015 03:34 PM, m-h-l wrote:

Funny thing is that g++, ArmC and ICC do not have a problem with "abcdef"[3]
as an initializer.

Neither does Fortran:

toon@moene:~/src$ cat g.f
      CHARACTER :: A = "12345"(3:3)
      PRINT *,A
      END

toon@moene:~/src$ gfortran g.f
toon@moene:~/src$ ./a.out
 3


--
Toon Moene - e-mail: toon@xxxxxxxxx - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news




[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