[Patch, Fortran] Allow ENTRY without RESULT (PR30873)

Tobias Burnus burnus@net-b.de
Fri Mar 2 08:50:00 GMT 2007


:ADDPATCH fortran:

gfortran did not like

    ENTRY E1(I)
without
    RESULT(result-name)

And prints this error:
-         gfc_error ("RESULT attribute required in ENTRY statement at %C");

However, the Fortran standard permits this and uses then the entry-name
as result-name - similar to functions without result-name.


R1235 entry-stmt is ENTRY entry-name [ ( [ dummy-arg-list ] ) [ suffix ] ]
C1252 (R1235) If RESULT is specified, the entry-name shall not appear in
any specification or type declaration statement in the scoping unit of
the function program.
C1254 (R1235) RESULT shall appear only if the entry-stmt is in a
function subprogram.
C1257 (R1235) If RESULT is specified, result-name shall not be the same
as the function-name in the FUNCTION statement and shall not be the same
as the entry-name in any ENTRY statement in the subprogram.


Found by Joost VandeVondele, thanks!

I could trace this check back to r69825:
* gcc/fortran: New front end.
This check is also no longer part of g95.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu
Ok for the trunk, 4.2 and for 4.1?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: entry.diff
Type: text/x-patch
Size: 1522 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070302/edde9a3c/attachment.bin>


More information about the Gcc-patches mailing list