public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51512] New: RFC: Bogus "Return value of function"/"INTENT(OUT) was not set" with allocatable results/dummies
@ 2011-12-12  8:41 burnus at gcc dot gnu.org
  2013-06-12  9:50 ` [Bug fortran/51512] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-12  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51512
           Summary: RFC: Bogus "Return value of function"/"INTENT(OUT) was
                    not set" with allocatable results/dummies
    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


gfortran -Wall prints for the following program:

  Warning: Return value of function 'f' at (1) not set

However, as "f" is allocatable, the program is valid and the function result is
an unallocated array.

RFC: Should we really print a warning? The program is valid, though most of the
time this indicates a programming error.

In GCC 4.3, gfortran did not warn; 4.4 to 4.7 do.


function f()
  integer, allocatable :: f(:)
end function f


Related:

  integer function f(x)
    integer, allocatable, intent(out) :: x(:)
    f = 5
  end function f

Again, gcc 4.5 (!) to 4.7 print a warning:
   Warning: Dummy argument 'x' at (1) was declared INTENT(OUT) but was not set

But again, the code is questionable but perfectly standard conform and in some
cases even useful.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/51512] RFC: Bogus "Return value of function"/"INTENT(OUT) was not set" with allocatable results/dummies
  2011-12-12  8:41 [Bug fortran/51512] New: RFC: Bogus "Return value of function"/"INTENT(OUT) was not set" with allocatable results/dummies burnus at gcc dot gnu.org
@ 2013-06-12  9:50 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-12  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-12
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed at revision 199988.

> RFC: Should we really print a warning? The program is valid, 
> though most of the time this indicates a programming error.

IMO this is exactly what warnings are for. I suggest to close this PR as
WONTFIX.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-12  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12  8:41 [Bug fortran/51512] New: RFC: Bogus "Return value of function"/"INTENT(OUT) was not set" with allocatable results/dummies burnus at gcc dot gnu.org
2013-06-12  9:50 ` [Bug fortran/51512] " 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).