TREE_PUBLIC for module symbols?

FX fxcoudert@gmail.com
Wed Jul 1 19:40:00 GMT 2015


> My thinking is that one could encrypt the private part of the module
> file but, being open source, the key would be visible and even a
> slightly determined hacker could expose the private entities. For this
> reason, I do not think that it is worth trying.

I don’t think there is any guarantee, anywhere, that PRIVATE entities are perfectly hidden to the user of a module. They already are present in the object file generated, if not currently in the module file. So I don’t think we should worry about that.

Said another way: PRIVATE is a way for the compiler to help you enforce the separation between inside and outside the module. Just as private in C++ headers is (as far as I understand it) a way for the compiler to enforce the gentleman’s agreement that is the API. Nothing more. Anybody relying on PRIVATE to protect their darkest secrets is doing it wrong.

FX


More information about the Fortran mailing list