Message ID | 20150515152547.GI82729@troutmask.apl.washington.edu |
---|---|
State | New |
Headers | show |
- You’re missing the match.c part of the patch (I really had a hard time figuring out how the patch was supposed to work! then I read the one posted in the PR) - Let’s avoid the strcmp() string comparison and use “op == INTRINSIC_NONE” as the condition (seems clearer and more efficient to me) - Maybe not doing all the tests (those after "The following if-statements”) if op == INTRINSIC_NONE, as all the s2 comparisons will be false. - The PR number in the ChangeLog is wrong (both times) With the above fixed, it’s OK. Thanks for taking care of all this! FX
On Fri, May 15, 2015 at 05:45:54PM +0200, FX wrote: > - You're missing the match.c part of the patch (I really had > a hard time figuring out how the patch was supposed to work! > then I read the one posted in the PR) Whoops, sorry about that. As you can see I have small patches sitting in my tree. I tried to untangle the 'svn diff' > - Let's avoid the strcmp() string comparison and use > 'op == INTRINSIC_NONE' as the condition (seems clearer and more > efficient to me) > - Maybe not doing all the tests (those after "The following > if-statements") if op == INTRINSIC_NONE, as all the s2 > comparisons will be false. > - The PR number in the ChangeLog is wrong (both times) Whoops copy-n-paste from one log to another. > With the above fixed, it???s OK. > Thanks for taking care of all this! I'll rework the patch to address your 2 suggestions.
> Whoops, sorry about that. As you can see I have small patches > sitting in my tree. I tried to untangle the 'svn diff’ Thanks for cleaning and submitting those! I’ll try to review them over the next 2 days, if nobody beats me to it :) FX
Index: gcc/fortran/interface.c =================================================================== --- gcc/fortran/interface.c (revision 223094) +++ gcc/fortran/interface.c (working copy) @@ -346,8 +346,12 @@ gfc_match_end_interface (void) break; m = MATCH_ERROR; - gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> at %C, " - "but got %s", s1, s2); + if (strcmp(s2, "none") == 0) + gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> " + "at %C, ", s1); + else + gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> at %C, " + "but got %s", s1, s2); } } Index: gcc/testsuite/gfortran.dg/interface_operator_1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/interface_operator_1.f90 (revision 0) +++ gcc/testsuite/gfortran.dg/interface_operator_1.f90 (working copy) @@ -0,0 +1,10 @@ +! { dg-do compile } +! PR fortran/66106 +! +! Original code from Gerhard Steinmetz +! <gerhard dot steinmetz dot fortran at t-online dot de> +program p + interface operator ( .gt. ) + end interface operator ! { dg-error "END INTERFACE OPERATOR" } +end program p ! { dg-error "END INTERFACE" } +! { dg-excess-errors "Unexpected end of file" }