Skip to content

Add default-visibility compile option. #2090

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bokic
Copy link
Contributor

@bokic bokic commented Apr 16, 2025

No description provided.

@lerno
Copy link
Collaborator

lerno commented Apr 17, 2025

I don't understand. What is this for?

@bokic
Copy link
Contributor Author

bokic commented Apr 17, 2025

for ex,
When building shared libraries you might only want explicitly marked functions to be exported, not all by default.
in C the solution is to add visibilty=hidden. Which will result in reduced number of exported functions.

And, when building executable functions should not to be exported by default.

And later at the linker phaze, linker will detect functions that are not exported and not used, so, will not put them into the binary, resulting smaller binary size.

@lerno
Copy link
Collaborator

lerno commented Apr 18, 2025

But that doesn't make sense for C3, since there is @export and @public. Only @export will be exported properly.

@lerno
Copy link
Collaborator

lerno commented Apr 26, 2025

So again I'm not sure here why this is needed.

@lerno lerno added the Additional info please Further information is requested label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Additional info please Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants