Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > bug in g95 with...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 10 Topic 8427 of 8908
Post > Topic >>

bug in g95 with character arrays?

by wim <wim.van.hoydonck@[EMAIL PROTECTED] > Jun 28, 2008 at 06:47 AM

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
 




 10 Posts in Topic:
bug in g95 with character arrays?
wim <wim.van.hoydonck@  2008-06-28 06:47:31 
Re: bug in g95 with character arrays?
Steve Lionel <steve.li  2008-06-28 14:38:12 
Re: bug in g95 with character arrays?
nospam@[EMAIL PROTECTED]   2008-06-28 08:54:52 
Re: bug in g95 with character arrays?
glen herrmannsfeldt <g  2008-06-28 10:03:49 
Re: bug in g95 with character arrays?
nospam@[EMAIL PROTECTED]   2008-06-28 10:26:18 
Re: bug in g95 with character arrays?
glen herrmannsfeldt <g  2008-06-28 11:43:33 
Re: bug in g95 with character arrays?
"robin" <rob  2008-07-01 03:53:17 
Re: bug in g95 with character arrays?
harper@[EMAIL PROTECTED]   2008-06-30 10:29:32 
Re: bug in g95 with character arrays?
"robin" <rob  2008-07-01 03:53:18 
Re: bug in g95 with character arrays?
wim <wim.van.hoydonck@  2008-06-28 10:14:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Nov 19 7:35:11 CST 2008.