public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61404] New: Incorrect error message when misusing a structure component + explicit interface
@ 2014-06-03 16:03 bardeau at iram dot fr
2014-06-03 22:41 ` [Bug fortran/61404] " dominiq at lps dot ens.fr
0 siblings, 1 reply; 2+ messages in thread
From: bardeau at iram dot fr @ 2014-06-03 16:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61404
Bug ID: 61404
Summary: Incorrect error message when misusing a structure
component + explicit interface
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: bardeau at iram dot fr
Dear gfortran developers,
gfortran issues an incorrect error message using the (invalid on purpose)
program below. It refers to the module providing the structure component,
instead of the actual line where the error lies (CALL statement). The bug is
observed with gfortran 4.9.0 but I also found it in gfortran 4.4.7, so it seems
to be here since a long time...
module gbl_message
type :: mytype
integer(kind=4) :: e
end type mytype
type(mytype), parameter :: seve = mytype(1)
end module gbl_message
!
module gbl_interfaces
interface
subroutine gagout(message)
character(len=*), intent(in) :: message
end subroutine gagout
end interface
end module gbl_interfaces
!
program test
use gbl_message
use gbl_interfaces
! Make an incorrect call according to the interface:
call gagout(seve%e,'Some string')
end program test
$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --with-gmp=... --prefix=...
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.9.0 (GCC)
$ gfortran test.f90
test.f90:17.6:
use gbl_message
1
Error: Type mismatch in argument 'message' at (1); passed INTEGER(4) to
CHARACTER(1)
You can see that the error message refers to the USE statement instead of the
CALL statement. If I change the line
call gagout(seve%e,'Some string')
by
call gagout(1,'Some string')
the error message is now correct.
Sebastien
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug fortran/61404] Incorrect error message when misusing a structure component + explicit interface
2014-06-03 16:03 [Bug fortran/61404] New: Incorrect error message when misusing a structure component + explicit interface bardeau at iram dot fr
@ 2014-06-03 22:41 ` dominiq at lps dot ens.fr
0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-06-03 22:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61404
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Duplicate.
*** This bug has been marked as a duplicate of bug 61318 ***
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-03 22:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-03 16:03 [Bug fortran/61404] New: Incorrect error message when misusing a structure component + explicit interface bardeau at iram dot fr
2014-06-03 22:41 ` [Bug fortran/61404] " dominiq at lps dot ens.fr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).