This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29657] New: Don't allow SAVE for functions


gfortran happily accepts the SAVE attribute for function (procedure attributes)

function sq(x)
  real, intent(in) :: x
  real, save :: sq  ! SAVE is wrong!
  sq = x**2
end function sq

g95:
Error: PROCEDURE attribute conflicts with SAVE attribute at (1)
sunf95:
ERROR: "SQ" is a function, therefore it must not be declared with the SAVE
attribute.
ifort:
The SAVE attribute conflicts with other declarations.
NAG f95:
Cannot SAVE procedure SQ


-- 
           Summary: Don't allow SAVE for functions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29657


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]