Skip to content

Commit

Permalink
Remove strtoq() and strtouq().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
enh-google authored and toukashishigaya committed Apr 1, 2024
1 parent 006e919 commit 92a9bed
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
10 changes: 0 additions & 10 deletions libc/bionic/strtol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ long long strtoll(const char* s, char** end, int base) {
return StrToI<long long, LLONG_MIN, LLONG_MAX>(s, end, base);
}

// Public API since L, but not in any header.
extern "C" long long strtoq(const char* s, char** end, int base) {
return strtoll(s, end, base);
}

unsigned long strtoul(const char* s, char** end, int base) {
return StrToU<unsigned long, ULONG_MAX>(s, end, base);
}
Expand All @@ -199,8 +194,3 @@ unsigned long long strtoull(const char* s, char** end, int base) {
uintmax_t strtoumax(const char* s, char** end, int base) {
return StrToU<uintmax_t, UINTMAX_MAX>(s, end, base);
}

// Public API since L, but not in any header.
extern "C" unsigned long long strtouq(const char* s, char** end, int base) {
return strtoull(s, end, base);
}
2 changes: 0 additions & 2 deletions libc/libc.map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1037,12 +1037,10 @@ LIBC {
strtold_l; # introduced=21
strtoll;
strtoll_l; # introduced=21
strtoq; # introduced=21
strtoul;
strtoull;
strtoull_l; # introduced=21
strtoumax;
strtouq; # introduced=21
strxfrm;
strxfrm_l; # introduced=21
swapoff; # introduced-arm=19 introduced-arm64=21 introduced-x86=19 introduced-x86_64=21
Expand Down

0 comments on commit 92a9bed

Please sign in to comment.