From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22222 invoked by alias); 27 Apr 2008 04:25:13 -0000 Received: (qmail 3767 invoked by uid 48); 27 Apr 2008 03:31:56 -0000 Date: Sun, 27 Apr 2008 04:25:00 -0000 Subject: [Bug fortran/36058] New: Not allowing pointers to derived types in COMMON X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "w6ws at earthlink dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg01902.txt.bz2 Gfortran is not allowing pointers to certain derived types to reside in COMMON. While there are constraints for derived type objects themselves (ref section 5.5.2 of F2003), there do not appear to be constraints on pointers to them. So it seems that gfortran is not considering 'pointeredness' when applying the constraint checks in 5.5.2. $ cat commonptr.f90 subroutine commonptr () implicit none type wws_t integer :: x = 1, y = 2, z = 3 end type type (wws_t), pointer :: my_wwsptr common /block/ my_wwsptr allocate (my_wwsptr) my_wwsptr = wws_t (3, 4, 5) end subroutine $ $ gfortran --version GNU Fortran (GCC) 4.3.0 20071222 (experimental) [trunk revision 127783] Copyright (C) 2007 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING $ gfortran -c commonptr.f90 commonptr.f90:8.36: type (wws_t), pointer :: my_wwsptr 1 Error: Derived type variable 'my_wwsptr' in COMMON at (1) has neither the SEQUENCE nor the BIND(C) attribute commonptr.f90:8.36: type (wws_t), pointer :: my_wwsptr 1 Error: Derived type variable 'my_wwsptr' in COMMON at (1) may not have default initializer $ -- Summary: Not allowing pointers to derived types in COMMON Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: w6ws at earthlink dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36058