-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Missing percent_encode<true>
symbol (on MacOS/clang)
#580
Comments
percent_encode<true>
symbol on MacOSpercent_encode<true>
symbol (on MacOS/clang)
@lemire Any idea how to prevent this? |
We don't want users to rely on The following might be sufficient (untested): --- a/include/ada/unicode.h
+++ b/include/ada/unicode.h
@@ -191,6 +191,9 @@ std::string percent_encode(std::string_view input,
template <bool append>
bool percent_encode(std::string_view input, const uint8_t character_set[],
std::string& out);
+template bool percent_encode<true>(std::string_view input,
+ const uint8_t character_set[],
+ std::string& out);
/**
* Returns the index at which percent encoding should start, or (equivalently),
* the length of the prefix that does not require percent encoding. But you probably want to move this line into a source file and use But this assumes that we want users of the ada library to call I would say that if we want people to use ada for percent encoding, we should design a proper interface. These functions were developed for our own use cases. They may have all sorts of assumptions builtin. |
For context, I came across this whilst writing In particular, it is required to not percent-encode the beginning of some URLs ( It's not the end of the world if this particular function remains private, but means an additional string allocation even if no percent-encoding is required (which is what I've done for now). |
I agree that solving issue 309 is desirable but the step forward is to actually go ahead and implement it in ada. Right? Exposing dirty bits seems like a step backward. |
Version
2.7.4
Platform
Darwin FWAMM008.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103 arm64
What steps will reproduce the bug?
Linking
libada.a
into a MacOS binary that usesada::unicode::percent_encode<true>
How often does it reproduce? Is there a required condition?
Windows and Linux (Ubuntu) seem fine. MacOS x86 and ARM both fail though. So presumably it's a
clang
thing.What is the expected behavior?
Linking succeeds.
What do you see instead?
Additional information
Note the lack of
percent_encode<true>
(onlyfalse
)I note via a GitHub search that
ada::unicode::percent_encode<false>
is used within Ada's own codebase, so is instantiated, whereas thetrue
specialisation is never used. So I suspect it's just never generated in the library binary.The text was updated successfully, but these errors were encountered: