-
Notifications
You must be signed in to change notification settings - Fork 264
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
[BUG] error: use of undeclared identifier 'strtouq' / 'strtoq' #1803
Comments
The following works:
The following does not work:
|
The following works:
The following does not work:
Apparently, is works from |
pcre's CMakeLists.txt uses So, don't think this is a ndk issue, rather cmake/pcre issue. |
@Grimler91 thank you! Any reason why it still works up to |
Don't know, haven't tested building with an older ndk. Maybe ndk developers have an idea |
i can kind of answer this... basically, strtoq() and strtouq() are in bionic, and have been since API 21. (despite the fact that they're not in any header file.) i don't know anything about cmake, but i suspect the difference there is that obviously the real question though is "why are they in libc.so but not in any header file?", and that's where i don't have a really satisfactory answer because i don't find any explicit record of any decisions in the history. as far as i can tell, the symbol was added by accident (possibly because we didn't even realize it wasn't in any header, and because it is available on macOS/iOS, so i may have thought "oh, that might be useful for developers" without questioning who in their right mind wouldn't just use strtoll() instead) and then when we discovered that we had the symbol but not the declaration (while i was cleaning up our strto*() functions for other reasons), we left it like that because we couldn't really justify the disruption of adding it the headers. |
@enh-google thanks that makes a lot of sense.
Would it make sense to add it to the headers then? |
It sounds like we should either add it to the header or remove it from the stub library. It sounds like it's probably better to just add it to the header, but if we for some reason don't want to make this available (I'm not familiar with the API, but if all we're doing is giving you yet-another-footgun, might be better to remove entirely), we should also remove it from the stubs. Being inconsistent is likely the worst option. |
it's not a footgun; it's just stupid. it's just non-standard names for strtoll/strtoull with an annoying return type that's an otherwise unused synonym for i've asked serbanc whether this is actually used by anything in the Play Store, but since the answer to that question is basically always "yes", i'm working on resigning myself to adding this to the header. it's likely to break someone who's defined strtoq() (perhaps for 128-bit, which would at least be useful!), but, yeah, being inconsistent is bad. |
AFAIK in this very case, PCRE has a fallback: #if defined HAVE_STRTOQ
long long r = strtoq(str, &end, radix);
#elif defined HAVE_STRTOLL
long long r = strtoll(str, &end, radix);
#elif defined HAVE__STRTOI64
long long r = _strtoi64(str, &end, radix);
#elif defined HAVE_STRTOIMAX
long long r = strtoimax(str, &end, radix);
#else
#error parse_longlong_radix: cannot convert input to a long-long
#endif So I guess
Any reason why those functions have been (apparently) removed from Can't we just revert the corresponding commit? |
no, i think you're reading that backwards ... or my understanding of reality is fundamentally broken :-) i think these are the facts:
the weird thing you're probably missing here is that the libc.so files in the NDK aren't real, and nor are they based on the ELF files that actually ship as part of the OS. they're based on a text file that describes -- or claims to, anyway -- what was in every release. afaict from this bug report (that is "unless you know something else that you haven't told me yet" :-) ), that text file (and thus the generated "fake" libc.so files in the NDK) are indeed correct. aiui what's changed here is that you've changed your build from targeting an API level that didn't have this function to one that did, and PCRE's "check the ELF file" test for symbol presence (which is a bad idea for several reasons, only one of which is this one) now sees it, but trips up when it tries to use it because this function has never had a declaration in any bionic header file. anyway, it turns out that there are no apps in the Play Store that refer to this symbol. so i'll upload a change today to remove it entirely, and even projects that do (misguidedly) look in ELF files for symbols rather than trying compile tests will "just work" once that makes its way into a released NDK... |
https://android-review.googlesource.com/c/platform/bionic/+/2295477 removes the aliases from bionic. |
Change is merged into bionic. I'll update the sysroot for r25 when we get a new toolchain so this will ship in r25c. |
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393 Signed-off-by: Jason Edson <jaysonedson@gmail.com>
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393 Signed-off-by: Jason Edson <jaysonedson@gmail.com>
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393 Signed-off-by: Jason Edson <jaysonedson@gmail.com>
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
These have been aliases for strtoll() and strtoull() since L, by accident. We've never exposed them in the headers, and they're unused by any apps. Let's fix the inconsistency between libc.so and its headers by removing the aliases. Bug: android/ndk#1803 Test: treehugger Change-Id: I87de7831c04b3e450a44e9f0386cacb73793e393
Description
Trying to compile PCRE 8.45, I got the following error:
error: use of undeclared identifier 'strtoq'
error: use of undeclared identifier 'strtouq'
Here is the complete command line:
Affected versions
r23, r24, r25
Canary version
No response
Host OS
Linux
Host OS version
Ubuntu 20.04
Affected ABIs
armeabi-v7a
Build system
CMake
Other build system
No response
minSdkVersion
19
Device API level
No response
The text was updated successfully, but these errors were encountered: