- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
here is the test code:
character(len=100)::buf
write(buf,*)0.,'ABC'
write(*,*)buf
end
With intel (Composer XE 2015) the output is
0.0000000E+00ABC
while with G95 it is
0. ABC
Note the space with G95, which allows a subsequent read(...,*).
This seems like a bug to me.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting. I see two problems here - the missing blank (which IS inserted if you write to a file), and the use of E format where the standard calls for F. I'm more than a bit astonished at this and will follow up with the developers. Thanks for reporting this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as issue DPD200380295, The issue arises only when doing internal writes, which is perhaps why we haven't seen this reported long ago. I played around with this some and suspect that we are actually using G format for the reals, which would not be correct. While your test case doesn't show this, /standard-semantics implies /assume:noold_ldout_format which changes how a real zero is formatted. This changed between Fortran 95 and Fortran 2003, and our default behavior is consistent with F95. What is strange is that if you enable /assume:noold_ldout_format, the formatting of zero changes for external files but not internal files!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This will be fixed for a major release later this year.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page