From 57c65fb59c62beb1cbe6db6be2e42c0a9a077915 Mon Sep 17 00:00:00 2001 From: Daniel Franke Date: Sun, 23 Dec 2007 12:34:45 -0500 Subject: re PR fortran/34536 (Make support of 2.0**-3*5 tighter: Print warning by default) gcc/fortran: 2007-12-23 Daniel Franke PR fortran/34536 * matchexp.c (match_ext_mult_operand): Print warning for unary operators following arithmetic ones by default. (match_ext_add_operand): Likewise. gcc/testsuite: 2007-12-23 Daniel Franke PR fortran/34536 * gfortran.dg/integer_exponentiation_2.f90: Fixed testcase. * gfortran.dg/real_const_3.f90: Likewise. * gfortran.dg/unary_operator.f90: New test. From-SVN: r131149 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/matchexp.c | 26 ++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 79c23de..6e99243 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-12-23 Daniel Franke + + PR fortran/34536 + * matchexp.c (match_ext_mult_operand): Print warning for unary + operators following arithmetic ones by default. + (match_ext_add_operand): Likewise. + 2007-12-22 Daniel Franke PR fortran/34559 diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c index c243101..0bc567f 100644 --- a/gcc/fortran/matchexp.c +++ b/gcc/fortran/matchexp.c @@ -345,10 +345,15 @@ match_ext_mult_operand (gfc_expr **result) if (i == 0) return match_mult_operand (result); - if (gfc_notify_std (GFC_STD_GNU, "Extension: Unary operator following " - "arithmetic operator (use parentheses) at %C") - == FAILURE) - return MATCH_ERROR; + if (gfc_notification_std (GFC_STD_GNU) == ERROR) + { + gfc_error ("Extension: Unary operator following " + "arithmetic operator (use parentheses) at %C"); + return MATCH_ERROR; + } + else + gfc_warning ("Extension: Unary operator following " + "arithmetic operator (use parentheses) at %C"); m = match_ext_mult_operand (&e); if (m != MATCH_YES) @@ -449,10 +454,15 @@ match_ext_add_operand (gfc_expr **result) if (i == 0) return match_add_operand (result); - if (gfc_notify_std (GFC_STD_GNU, "Extension: Unary operator following " - "arithmetic operator (use parentheses) at %C") - == FAILURE) - return MATCH_ERROR; + if (gfc_notification_std (GFC_STD_GNU) == ERROR) + { + gfc_error ("Extension: Unary operator following " + "arithmetic operator (use parentheses) at %C"); + return MATCH_ERROR; + } + else + gfc_warning ("Extension: Unary operator following " + "arithmetic operator (use parentheses) at %C"); m = match_ext_add_operand (&e); if (m != MATCH_YES) -- cgit v1.1