fno-backslash not available in gfortran
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Tue Jun 21 18:00:00 GMT 2005
Steve Kargl wrote:
> On Tue, Jun 21, 2005 at 09:07:35AM -0700, Richard E Maine wrote:
>>Frankly, I consider -fbackslash (without the "no") to be a
>>bug and a violation of the standard. If the backslash is a graphic
>>character in the processor's character set (which it seems to be as far
>>as I can tell), then the standard specifies that it can be used in
>>literal character strings without any special provisions. One might be
>>able to claim standard-conformance by tiptoeing around with enough
>>double-talk such as claiming that it is a control character instead of
>>a graphic one, I suppose. Such word tricks won't work in f2003,
>>however, because the backslash is part of the standard's required
>>character set then.
>
>
> Tobi, FX, Toon, Paul B.,
>
> Can we agree to reverse the default behavior? If I have
>
> print *, '1\n2'
> end
>
> It should print "1\n2" not
> 1
> 2
>
> Yes, this will break backwards compatibility with g77, but I beginning
> to think that backwards compatibility with g77 is an albatross.
>From an esthetical standpoint, either way is ok to me, interaction with the
preprocessor might be a problem, especially if the combination '\"' is in the
source code.
One thing to consider is that this is a case where code will compile perfectly
well if we change the default, but the code will behave differently. But then
people use ifort as a replacement for g77, and its defaults are the other way
round, so the problems might not be as grave. Also, we already had a release;
of course we could market this as a bugfix :-)
For comparison:
schluter@pcl247d:~> cat p.f90
print *, "a\nb"
end
schluter@pcl247d:~> ifort -v
Version 8.1
schluter@pcl247d:~> ifort p.f90
schluter@pcl247d:~> ./a.out
a\nb
schluter@pcl247d:~> pgf90 -V
pgf90 6.0-2 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
schluter@pcl247d:~> pgf90 p.f90
schluter@pcl247d:~> ./a.out
a
b
schluter@pcl247d:~>
Both compilers have options to change their behavior.
- Tobi
More information about the Fortran
mailing list