-
Notifications
You must be signed in to change notification settings - Fork 174
Avoid symbol collision with aklomp/base64 #235
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
base: master
Are you sure you want to change the base?
Conversation
benmcollins
left a comment
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.
Thank you for the patch. I wonder if it's worth moving base64.c into jwt.c where that is the only place it's used and make the functions static.
The fewer places where things are exported that aren't meant to be pubic interfaces, the better.
libjwt/base64.h
Outdated
| extern unsigned int base64_encode(const unsigned char *in, unsigned int inlen, | ||
| char *out); | ||
| extern unsigned int jwt_base64_encode(const unsigned char *in, | ||
| unsigned int inlen, char *out); |
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.
Make the second line of the declaration (and similarly on the one below) align with the first paren on the first line (tabs are 8 spaces).
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.
Make the second line of the declaration (and similarly on the one below) align with the first paren on the first line (tabs are 8 spaces).
I think I got it right now. 😅
b23dc4d to
2f98d1f
Compare
Yep, that would certainly help here! Happy to move the code around if you want. |
That would be very much appreciated. Thanks! |
In static builds, symbol collisions are possible since the functions are named the same. Embed the base64 library in the only file where it's used and make all its functions static.
2f98d1f to
859ce12
Compare
|
Done, moved it all to jwt.c! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #235 +/- ##
==========================================
+ Coverage 99.68% 99.73% +0.05%
==========================================
Files 15 14 -1
Lines 1902 1902
==========================================
+ Hits 1896 1897 +1
+ Misses 6 5 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
In static builds, symbol collisions are possible since the functions are named the same.
Hey there, thank a lot for your library!
I ran intro this because I'm already using aklomp/base64 in a C++ application where a lot of base64 encoding is taking place, and recently added your library as a static library.