This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/77260] New: bogus warning with ENTRY in a function
- From: "martin at mpa-garching dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Aug 2016 08:36:43 +0000
- Subject: [Bug fortran/77260] New: bogus warning with ENTRY in a function
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77260
Bug ID: 77260
Summary: bogus warning with ENTRY in a function
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: martin@mpa-garching.mpg.de
Target Milestone: ---
Created attachment 39460
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39460&action=edit
test case
When compiling the test case below, current trunk gfortran warns about "f2"
being unused:
martin@martin-Latitude-E7450 ~/tmp $ gfortran -std=f2008 -W -Wall entry.f90
entry.f90:11:8:
entry f2
1
Warning: Fortran 2008 obsolescent feature: ENTRY statement at (1)
entry.f90:9:10:
integer f2
1
Warning: Unused variable ‘f2’ declared at (1) [-Wunused-variable]
However, if I comment out the "integer f2" statement, gfortran produces an
error (as I would expect):
martin@martin-Latitude-E7450 ~/tmp $ gfortran -std=f2008 -W -Wall entry.f90
entry.f90:11:8:
entry f2
1
Warning: Fortran 2008 obsolescent feature: ENTRY statement at (1)
entry.f90:4:12:
public f1,f2
1
Error: Contained function ‘f2’ at (1) has no IMPLICIT type
entry.f90:17:4:
use foo
1
Fatal Error: Can't open module file ‘foo.mod’ for reading at (1): No such file
or directory
compilation terminated.
I think the warning is bogus ... the entry somehow must be given an explicit
return type.
This behaviour happens on trunk and 5.4; I haven't tested other branches so
far.