-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang] Do not leak intrinsics used by ISO_C_BINDING and ISO_FORTRAN_ENV #79006
Conversation
@@ -22,6 +22,12 @@ module iso_c_binding | |||
c_sizeof => sizeof, & | |||
operator(==), operator(/=) | |||
|
|||
implicit none | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to add the private
statement on line 26 so that everything is private by default and then add explicit public
statements for the things you want to be public. This way, future additions don't leak by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Even though it's way more to change, I like the suggestion as it's future proof. Please have a look at the new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; thanks!
Please have another look. @rzurob Had a good suggestion to turn the logic around and make everything private by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
…bols (#80833) This PR continues the work started with PR #79006, by setting visibility in MODULES to PRIVATE by default and explicitly exporting only the desired symbols. `omp_lib` needs more work, as it should maybe be compiled from `omp_lib.f90` in `openmp/runtime/src/incluce/omp_lib.f90.var` instead of simply using an INCLUDE for `omp_lib.h`
This resolves bug #78953. Intrinsics used by the MODULE definition are being declared PRIVATE, so that they do not leak into the namespace of the code that USEs the modules.