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: unassig...@gcc.gnu.org ReportedBy: bur...@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