This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran,patch] Add -fmodule-private option (PR 31629)
- From: FX Coudert <fxcoudert at gmail dot com>
- To: GNU Fortran <fortran at gcc dot gnu dot org>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 9 Aug 2007 23:19:33 +0100
- Subject: [gfortran,patch] Add -fmodule-private option (PR 31629)
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=CDhysgrnEIj8fpdmZKMmq6MGUmYrKmIWazGIjEB0TheonL2MOzC2joa52oJIAOM7Uf6KzR4E99ai75gIwvCVlRJoqaa+R1PyFB/EjgkqXFH/tvkAkgtT9HjFLAkIT0spDOsD6f0PBAQb9Sf5rvPPc1F0BrvsDqZ1GkKwNrrKp4I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=Heq8st2J5pq5mJ3bvGM8XpOYhmLn2S0CscOrRa0KMlm7sjBQePH78HFCWTcwG3nyINLc4MwlLamjWjw1/CVuEeKkLwn+Q5fFHc5Ds43xsy3kXNlzieAuSwhMY7JEc3Pxnp6SB5Mqe3KRzxgTPFm+G8oXkQEoCTwngTuVdGUh2iQ=
The attached simple patch adds a -fmodule-private option to make
module entities private as default, i.e. when you USE a module and
compile with this option, you cannot refer to any variable that
wasn't explicitly declared as PUBLIC. This is a tool and help for
some people's coding style.
It's very simple as the code was already factored nicely, so it's in
fact a one-liner (plus option-handling stuff, documentation and
testcase). Bootstrapped and regtested on x86_64-linux, OK to commit?
FX
:ADDPATCH fortran:
Attachment:
module_private.ChangeLog
Description: Binary data
Attachment:
module_private.diff
Description: Binary data