Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

f95 long string bug workaround

807575Mar 17 2007
Recently I reported a bug in Sun f95 (internal review ID 926528) in which initializing a character variable with length > 1024 made the compiler crash. The offending program:

PROGRAM sunbuglongstring ! character*1025
CHARACTER:: longstring*1025='<'//repeat('.',1023)//'>'
PRINT '(1X,2A)',longstring(1:1),longstring(1025:1025)
END PROGRAM sunbuglongstring

ought to print <>. After sending that bug report I found a simple workaround: separate the initialization from the declaration by

PROGRAM sunbuglongstring1 ! character*1025
CHARACTER:: longstring*1025
longstring = '<'//repeat('.',1023)//'>'
PRINT '(1X,2A)',longstring(1:1),longstring(1025:1025)
END PROGRAM sunbuglongstring1

which compiled and ran OK.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2007
Added on Mar 17 2007
0 comments
218 views