 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
| View previous topic :: View next topic |
| Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2428 Location: Yateley, Hants, UK
|
Posted: Fri Dec 03, 2010 6:25 pm Post subject: Character Array A(1) can't be initialised in DATA |
|
|
I have a bit of old code where a number of character arrays are declared thus:
| Code: |
| CHARACTER*(30) A(10), B(10), C(1) |
They are then initialised in DATA statements. C started out as 10 elements long as well, but as I never got round to using C(2) onwards, I must at some time around 1985 have reduced it to C(1), so that the DATA statement looks simply like:
| Code: |
| DATA C/'123456789012345678901234567890'/ |
If I compile without -O, the code compiles and runs correctly as far as I can tell. If I use -O, the code generates two errors:
| Quote: |
| Assumed-size errors cannot appear in a DATA statement |
(which gives the line number of the DATA statement) and
| Quote: |
| C is an assumed-size array (bound of *), but is not an argument |
which gives the line number of the declaration.
The workaround is to make C have the dimension (2), so it isn't serious, although I do have to put 30 useless characters in the data statement for C(2).
I'm using an old 4.90 version. Is this the same error fixed at 5.20 and referred to in the bugs fixed list under the note:
| Quote: |
| /OLD_ARRAYS gives a false error report when A(1) is not an argument |
It is probably connected.
Regards
Eddie |
|
| Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8283 Location: Salford, UK
|
Posted: Sat Dec 04, 2010 12:25 pm Post subject: |
|
|
| I have tested this on version 5.5/6.0 and the problem appears to have been fixed. |
|
| Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2428 Location: Yateley, Hants, UK
|
Posted: Sat Dec 04, 2010 1:07 pm Post subject: |
|
|
Hi Paul,
It's me, sorry. I didn't realise that -O was "-Old_Arrays" not "-Optimise". No blooming wonder!
Any way of removing this thread?
Eddie |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|