Bug 31470 - A program with an empty CONTAINS block is illegal, but gfortran accepts it
Summary: A program with an empty CONTAINS block is illegal, but gfortran accepts it
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-04 17:29 UTC by Michael Richmond
Modified: 2007-04-04 17:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Richmond 2007-04-04 17:29:35 UTC
A program with an empty CONTAINS block is illegal, but gfortran accepts it:

PROGRAM test197
CONTAINS
END PROGRAM test197
Comment 1 Tobias Burnus 2007-04-04 17:35:59 UTC
> A program with an empty CONTAINS block is illegal

Well, this is a matter of arguments. It is invalid in Fortran 90, 95 and 2003. But it is allowed in the current draft for Fortran 2008.

Therefore, we decided to allowed it by default.

Use -std=f2003 or -std=f95 to print an error.


END PROGRAM test197
                  1
Error: Extension: CONTAINS statement without FUNCTION or SUBROUTINE statement at (1)