This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Fortran G77 bug or feature?
- From: "Rien Timmer" <Rien dot Timmer at wxs dot nl>
- To: <gcc-bugs at gcc dot gnu dot org>
- Date: Wed, 2 Oct 2002 16:37:27 +0200
- Subject: Fortran G77 bug or feature?
- Reply-to: <Rien dot Timmer at wxs dot nl>
The Fortran statements
PRINT *, 'Hello World!'
PRINT *, ' Hello World!'
should produce the output
ello World!
Hello World!
but instead it prints
Hello World!
Hello World!
Another example, the program:
print 10, ' 1'
10 format(a2,$)
print 10, '+2'
print 10, '+3'
print 10, '+4'
print 10, '+5'
print 10, '+6'
end
should produce the output:
123456
but using the g77 compiler it outputs:
1+2+3+4+5+6
This is wrong!
If you look at section 12.9.5.2.3 (Printing of Formatted Records) in the
Fortran standard, it reads:
If a formatted record is printed, the first character of the record is not
printed.
The first character of such a record determines vertical spacing as follows:
________________________________________________
| | |
| Character | Vertical Spacing Before Printing |
|___________|__________________________________|
| | |
| Blank | One Line |
| 0 | Two Lines |
| 1 | To First Line of Next Page |
| + | No Advance |
|___________|__________________________________|
Is this a bug is the Force 2.0 environment I'm using or in the underlying
G77 compiler and run-time system?
Rien Timmer
The Netherlands
Fortran veteran of Digital Equipment Corporation's RSX and VMS systems.