refactor: deprecate *NUM constants fitting #3131#5123
Open
dybucc wants to merge 1 commit into
Open
Conversation
_NUM*NUM constants fitting #3131
These symbols, alongside those matching the `_MAX`, `_COUNT` and `_LAST`-suffixed constants, have been deprecated in favor of keeping more stable SemVer guarantees. For more on the reasons why some of these constants were deprecated, while others weren't, see the accompanying PR.
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Constants matching the
*NUMnaming scheme whose purpose is that of denoting a limit amongother symbols have been deprecated in this patch. This stems from the deprecation efforts in #3131.
This is a follow up PR to #5120.
Sources
The
WCTYPE_ALNUMconstant in the TEEOS tree has not been deprecated because I could not find thesymbol in the OpenHarmony SDK. I tried with all versions of the latest SDK as released in both
their GitHub and their Gitee, but I had no luck after running
rgwith the following command.The
PT_NUMin the Fuchsia source constant has not been deprecated because it does not seem to beused as a limit of any sort.
https://cs.opensource.google/search?q=pt_num&sq=&ss=fuchsia%2Ffuchsia:zircon%2F
The
AT_PHNUMconstant in NetBSD, FreeBSD, Android and Linux/L4RE has not been deprecated as theaccompanying comments mention they are supposed to denote some number of entries, which I assume
as not implying the type of "limit" value we're looking to deprecate.
https://github.com/search?q=repo%3ANetBSD%2Fsrc%20AT_PHNUM&type=code
https://github.com/search?q=repo%3Afreebsd%2Ffreebsd-src%20AT_PHNUM&type=code
https://github.com/search?q=repo%3Atorvalds%2Flinux%20at_phnum&type=code
https://cs.android.com/search?q=at_phnum&sq=&ss=android%2Fplatform%2Fsuperproject
The
VFS_MAXTYPENUMFreeBSD constant has not been deprecated because it does not seem to be usedas a the type of "limit" value we've deprecated in related PRs.
https://github.com/search?q=repo%3Afreebsd%2Ffreebsd-src+VFS_MAXTYPENUM&type=code
The
B_DEV_BAD_DRIVE_NUMconstant under the Haiku tree has not been deprecated as it seems tojust be another enum variant among a few other constants denoting errors.
https://github.com/search?q=repo%3Ahaiku%2Fhaiku%20B_DEV_BAD_DRIVE_NUM&type=code
The
ELFCLASSNUMandEV_NUMLinux and L4RE constant have been deprecated as the context inwhich they are used in the upstream codebase and the fact they are trailing constants after two
other symbols, implies they're the type of "limit" values we would want to deprecate.
https://github.com/search?q=repo%3Atorvalds%2Flinux%20ELFCLASSNUM&type=code
https://github.com/torvalds/linux/blob/f5e5d3509bffb95c6648eb9795f7f236852ae62d/include/uapi/linux/elf.h#L380
The
ELFDATANUMLinux and L4RE constant has not been deprecated because I could not find it inneither one of the Linux nor L4RE upstream repos (neither kernels.)
The
ET_NUMandPT_NUMconstants in Linux and L4RE have not been deprecated because I could notfind them in neither one of the Linux nor L4RE repos.
https://github.com/torvalds/linux/blob/f5e5d3509bffb95c6648eb9795f7f236852ae62d/include/uapi/linux/elf.h#L72
https://github.com/search?q=repo%3AL4Re%2Ffiasco%20%2F%5B%5E%5B%3Aalpha%3A%5D%5Det_num%2F&type=code
https://github.com/search?q=repo%3Atorvalds%2Flinux+PT_NUM+path%3A%2F%5Einclude%5C%2F%2F&type=code
https://github.com/search?q=repo%3AL4Re%2Ffiasco+pt_num&type=code
The
ED_INVALID_RECNUMconstant in the GNU Hurd was not deprecated as the comment alongside itsdeclaration does seem to imply it's not the type of "limit" value we're looking to depreacte.
https://cgit.git.savannah.gnu.org/cgit/hurd/glibc.git/tree/sysdeps/mach/hurd/bits/errno.h?h=t/sysvshm#n407
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI