bug in g95 with character arrays?



Hi all,

ifort and gfortran compile the following without complaining:

$ cat mtest.f90
module mtest
implicit none
character(len=5), parameter :: test(5) =
["tan","atan2","atan","sin","asin"]

end module mtest

Not so with g95:

$ g95 -c -o mtest.o mtest.f90
In file mtest.f90:3

character(len=5), parameter :: test(5) =
["tan","atan2","atan","sin","asin"]
1
Error: Element in character array constructor at (1) has length 5
instead of 3

Does the standard say anything about what the compiler should do with
the elements in a character array that have a length shorter than the
one defined by its length, or should i always pad string parameters
with spaces by hand?

Still, this is a bug i think, as g95 doesn't take the declared length
into account but uses the length of the first element in the array?


Greetings,

Wim
.