"MODULE attribute conflicts with PROCEDURE attribute" this error message is not accurate enough. The conflicting attribute should be mentionned. For instance in: module abc contain function abc() .... The conflicting attributes is the name of the module and the name of the function. this is valid for: GNU Fortran 95 (GCC) 4.1.0 20051015 (experimental) Copyright (C) 2005 Free Software Foundation, Inc. on Linux descartes 2.6.13-1.1526_FC4smp #1 SMP Wed Sep 28 19:28:24 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
Full testcase: module abc contains function abc() i=1 end function end module There is actually two problems here, the first is the message about the conflicts is not very clear. The second issue is that the error recovery is not really good in that we don't really enter a function scope (sorry I am using C terms, I don't know a better way of describing the issue).
(In reply to comment #1) > Full testcase: > module abc > contains > function abc() > i=1 > end function > end module > > > There is actually two problems here, the first is the message about the > conflicts is not very clear. The second issue is that the error recovery is > not really good in that we don't really enter a function scope (sorry I am > using C terms, I don't know a better way of describing the issue). > Sorry for being unclear. 1) The error in the test case is that the function and the module have the same name. 2) The problem with gfortran is not that it does any mistake. It's just that the output error message is not clear enough. 3) sorry for not having put a "complete" dummy test case. here it is module abc contains function abc(i) integer::i,abc abc=i end function abc end module abc
Pierre, using your example from comment #2, would you consider subroutine abc() 1 Error: MODULE attribute of 'abc' conflicts with PROCEDURE attribute at (1) ^^^^^^^^ an improvement, or is something else wrong with this message?
> > subroutine abc() > 1 > Error: MODULE attribute of 'abc' conflicts with PROCEDURE attribute at (1) Hi, Yes this is already much more clear. Yet I wonder if "MODULE attribute of 'abc'" could be changed into something like """Module denomination attribute (='abc') ...""" regards PMA
The message text is not hardcoded and used to report multiple kinds of clashes, thus its genericity. Adding the name is easy, special-casing it for any combination of clashing is, IMO, not a viable option.
Subject: Bug 24633 Author: dfranke Date: Fri May 18 13:25:07 2007 New Revision: 124828 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124828 Log: 2007-05-18 Daniel Franke <franke.daniel@gmail.com> PR fortran/24633 * symbol.c (gfc_add_flavor): Add the NAME to error message if available. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/symbol.c
Fixed in trunk, the changes will not be backported to 4.2. Closing.