From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14154 invoked by alias); 9 Nov 2005 17:37:53 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14137 invoked by uid 48); 9 Nov 2005 17:37:51 -0000 Date: Wed, 09 Nov 2005 17:37:00 -0000 Subject: [Bug fortran/24759] New: Unclear error message X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "schnetter at aei dot mpg dot de" X-SW-Source: 2005-11/txt/msg01303.txt.bz2 List-Id: The code subroutine a (emask) implicit none real, intent(in) :: emask(:,:,:) logical :: left(3), right(3) integer :: i,j,k i=1; j=1; k=1 left=.false. right=.false. if (.not.right(3)) left(1) = abs(emask(i,j,k+1)-1)<0.01) end subroutine a contains an error in the if statement. The last closing parenthesis in this line must not be there. When compiled with gfortran, the error message is $ ~/gcc/bin/gfortran --version GNU Fortran 95 (GCC) 4.1.0 20051030 (experimental) $ ~/gcc/bin/gfortran -c unclassifyable.f90 In file unclassifyable.f90:9 if (.not.right(3)) left(1) = abs(emask(i,j,k+1)-1)<0.01) 1 Error: Unclassifiable statement in IF-clause at (1) This may be technically correct, but I wonder whether it would be possible to count parentheses and detect the mismatch. I'm aware of the fact that classifying statements in Fortran requires e.g. looking for equal signs and commas that are not enclosed in parentheses, so that mismatching parantheses can throw the classifier off. But the classifier probably already contains parentheses matching code, and reporting the mismatch would lead to a better error message. -- Summary: Unclear error message Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: schnetter at aei dot mpg dot de GCC build triplet: powerpc-apple-darwin8.3.0 GCC host triplet: powerpc-apple-darwin8.3.0 GCC target triplet: powerpc-apple-darwin8.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24759