From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23412 invoked by alias); 27 Apr 2008 15:31:09 -0000 Received: (qmail 23320 invoked by uid 48); 27 Apr 2008 15:30:25 -0000 Date: Sun, 27 Apr 2008 15:31:00 -0000 Message-ID: <20080427153025.23319.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/36058] Not allowing pointers to derived types in COMMON In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" 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/msg01923.txt.bz2 ------- Comment #3 from burnus at gcc dot gnu dot org 2008-04-27 15:30 ------- See also: http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/773de8d5b57f8e20 (In reply to comment #2) > I am only concerned with the POINTER case. I am not placing a > derived type object in the COMMON block. I am only storing a > pointer to it. But still you want (at least potentially) to access the pointer target at different scopes. And then the type declaration needs to be the same (storage wise), which is only guaranteed for SEQUENCE. Additionally and more formally, the storage unit for a pointer is different if the type is different (16.4.3.1 Storage sequence, item (8)) and without SEQUENCE they describe different types [see 4.5.1.3 Determination of derived types]. Thus I maintain that this is invalid. I'm however less sure about using a derived type with default initializer and a pointer in a common. Let's see what will be the reply in comp.lang.fortran. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36058