This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34536] Make support of 2.0**-3*5 tighter: Print warning by default
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2007 14:04:55 -0000
- Subject: [Bug fortran/34536] Make support of 2.0**-3*5 tighter: Print warning by default
- References: <bug-34536-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from burnus at gcc dot gnu dot org 2007-12-20 14:04 -------
> Exponentation has a higher precedence than multiplication, so
> 2.0**-3*5 <=> (2.0**(-3)) * 5
You forgot about the minus sign. You have:
[constant][exponent][minus][constant][times][constant]
and not
[constant][exponent][level-1 expr][times][constant]
(with level-1 expr = "([unary minus][constant])"
Thus one can say: [times] comes before [minus] and thus:
[2.0][exponent]([minus]([3][times][5])
but one can also claim that the exponent comes first and the user probably
meant an unary [minus]:
([2.0][exponent]([minus][3]))[times][5]
a) is what intel does (without -stand f03)
b) is what gfortran does (without -std=f2003)
I cannot find exactly where it is forbidden, but it boils down that
expression operator expression
is allowed and
expression operator operator expression
is not. Also all compilers agree that it is non-standard Fortran.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34536