This change is a follow up to commit 536456a7e93d73b9ff4e92f3e51d1aa1c72628fe
and limits UCharMax to the min of the maximum values for the
architecture's maximum unsigned char or maximum int values. This is
required for architectures where these values are different than the
most commonly supported architectures.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks good to me! Thanks!
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | ||
---|---|---|
514 | Perhaps it would be more precise to refer to the argument of these functions. So The C standard states that the arguments of functions like isalpha must be representable ... | |
517 | Could you please spell out ISA? Maybe it is just me but I don't know what that stands for. |
@Charusso, I cannot find a way to create a test for this change, since this was found using an architecture that supports 16-bit chars. I understand the need to create test cases for changes. In this case, I believe a rationale for accepting this change is to conform to the C Standard, and accept that upstream clang does not have a way to test for architectures supporting 16-bit characters, or otherwise "peculiar" datatypes.
Please do indicate if you're willing to accept this patch or not. If not, I need to know so I solve this problem for my customer in a different way.
Thank you - Vince
I really felt that we could write a test that using a target which behaves like that. I am not that awesome with triples, sorry. If I am right we are good to go without @NoQ's response (he is the maintainer of the Analyzer). Thanks!
Aha, ok, i appreciate making life easier for downstream users.
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | ||
---|---|---|
519 | Let's rename this constant then, so that we still had our UCharMax when we actually need the real UCHAR_MAX in the summary. |
I believe all comments have been addressed. Please let me know if there's anything else required. Thanks
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | ||
---|---|---|
519 | Done, thanks Artem. |
I think you have solved everything. Do you have commit access? May you would request it: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access
Whoops, i accidentally landed this patch because i misread your statement as if you're asking to land the patch for you :) Please request commit access anyway :)
Perhaps it would be more precise to refer to the argument of these functions. So The C standard states that the arguments of functions like isalpha must be representable ...