This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50923] New: [4.4/4.5/4.6/4.7 Regression] No warning if function return value is not set
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 30 Oct 2011 17:21:14 +0000
- Subject: [Bug fortran/50923] New: [4.4/4.5/4.6/4.7 Regression] No warning if function return value is not set
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50923
Bug #: 50923
Summary: [4.4/4.5/4.6/4.7 Regression] No warning if function
return value is not set
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
The following program compiles without any warning (not even with -Wall
-Wextra).
Expected: A default-option warning like:
integer pure function f()
1
Warning: Return value of function 'f' at (1) not set
Note: If one has a non-contained function, gfortran prints the warning shown
above - but for internal functions or module functions it does not. It also
works if one specifies a result(variable).
Note 2: In GCC 4.3 and earlier, the warning was printed by the middle end.
module m
contains
integer pure function f()
end function f
end module m