From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65532 invoked by alias); 13 Jul 2015 15:44:19 -0000 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 Received: (qmail 65478 invoked by uid 48); 13 Jul 2015 15:44:14 -0000 From: "sfilippone at uniroma2 dot it" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52846] [F2008] Support submodules Date: Mon, 13 Jul 2015 15:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sfilippone at uniroma2 dot it X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01052.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52846 --- Comment #8 from Salvatore Filippone --- (In reply to Paul Thomas from comment #7) > Created attachment 35926 [details] > A partially cooked patch to complete the implentation of submodules > > The attached is a first attempt to complete the submodule implementation > such that private entities are correctly dealt with. > > There are two parts to the patch: > > (i) Modifications to the front end to write a second half to the module > files, which contains all the information about the private entities in the > module. This is the bulk of the patch; and > > (ii) A change in the way that declarations of private entities are handled > in trans-decl.c. This follows a suggestion from Richard Biener to use a > technique borrowed from g++. In this patch it is only applied to variables. > ............ > Cheers > > Paul Seems to work for my codes. I am not completely happy with the fact that a change in the PRIVATE entities will cause a change of the .mod file; it may be argued that changes are more likely to occur in the submodules than in the main module, but still, this is not 100% satisfactory wrt the advertisement that submodules are ssolving the compilation cascade problem. >>From a user's point of view, I do not see a good solution to this; if the .mod file contains any kind of timestamp, it's going to change anyway, even in the case where the PRIVATE part is written to a separate file. On a relate note, the point raised in the mailing list about protecting trade secrets by putting them in the PRIVATE parts is IMHO moot: if I really wanted to protect trade secrets, I would put them in a separate module that is only ever USEd by the implementation files of the user visible module, files of which I only distribute the object code. I don't think that C++ is any different in this respect. Salvatore