Skip to content
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

Mark suitable variables and functions static #147

Closed

Conversation

emaxx-google
Copy link
Contributor

No description provided.

@emaxx-google emaxx-google marked this pull request as ready for review October 23, 2024 20:45
@LudovicRousseau
Copy link
Owner

I see not all variables are declared static, like the DriverOptions in src/ifdhandler.c because the code would not work any more.

Is the patch still useful if not 100% complete?
What real problem is solved by this patch?

@emaxx-google
Copy link
Contributor Author

emaxx-google commented Oct 23, 2024

I see not all variables are declared static, like the DriverOptions in src/ifdhandler.c because the code would not work any more.

Is the patch still useful if not 100% complete? What real problem is solved by this patch?

It seems generally useful to mark "local" things as static, so that they can't cause symbol collision between different source files.

Stuff that's used in different files remains non-static as it has to be - this is not the goal of the patch. Neither is minimizing the set of the symbols exported by the .so file, but, BTW, wasn't -fvisibility=hidden lost during the transition to meson? (nm -g --defined-only prints a much bigger set for a meson-built .so file than for the automake-built one)

LudovicRousseau added a commit that referenced this pull request Oct 24, 2024
We now have:
$ nm -g --defined-only libccid.so
000000000000bf90 T IFDHCloseChannel
000000000000ea40 T IFDHControl
000000000000bf80 T IFDHCreateChannel
000000000000bf70 T IFDHCreateChannelByName
0000000000010ad0 T IFDHGetCapabilities
0000000000010880 T IFDHICCPresence
000000000000c1b0 T IFDHPowerICC
000000000000c030 T IFDHSetCapabilities
000000000000c5d0 T IFDHSetProtocolParameters
000000000000e260 T IFDHTransmitToICC

Thanks to Maksim Ivanov for the idea
" Mark suitable variables and functions static #147 "
#147
@LudovicRousseau
Copy link
Owner

Merged in bbc733f

Thanks

@emaxx-google emaxx-google deleted the static-attr branch October 24, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants