This is an archive of the discontinued LLVM Phabricator instance.

[libc][NFC] Add explicit casts to ctype functions
ClosedPublic

Authored by gAlfonso-bit on Jul 27 2021, 11:47 AM.

Details

Reviewers
sivachandra
Group Reviewers
Restricted Project
Restricted Project
Commits
rG9cdd4ea06f09: [libc][NFC] Add explicit casts to ctype functions

Diff Detail

Event Timeline

gAlfonso-bit created this revision.Jul 27 2021, 11:47 AM
gAlfonso-bit requested review of this revision.Jul 27 2021, 11:47 AM

Formatted changed lines

gAlfonso-bit retitled this revision from [libc] Add explicit casts to ctype functions to [libc][NFC] Add explicit casts to ctype functions.Jul 27 2021, 2:15 PM
This comment was removed by gAlfonso-bit.
gAlfonso-bit added a subscriber: MaskRay.
gAlfonso-bit edited reviewers, added: ldionne; removed: MaskRay.Jul 28 2021, 8:41 AM

Rebased to LLVM 13's release branch

gAlfonso-bit edited reviewers, added: sivachandra; removed: ldionne.Jul 28 2021, 12:31 PM

Rebased to current

sivachandra accepted this revision.Aug 2 2021, 9:46 AM
This revision is now accepted and ready to land.Aug 2 2021, 9:46 AM
sivachandra edited the summary of this revision. (Show Details)Aug 2 2021, 10:59 PM
sivachandra requested changes to this revision.Aug 2 2021, 11:16 PM

This patch causes of number of failures in ctype tests. I have not investigated but this change does operations on numbers of different sizes and hence is leading to unexpected results.

This revision now requires changes to proceed.Aug 2 2021, 11:16 PM

Addressed failing tests

gAlfonso-bit updated this revision to Diff 364586.EditedAug 5 2021, 12:51 PM

Added context to patch

Can you please rebase this so that I can apply and test it?

Can you please rebase this so that I can apply and test it?

Done!

Sorry for the delay, its been hectic for me. I will test this out and submit if everything looks good by the end of the day today (US pacific time).

The test for isprint is still failing.

The test for isprint is still failing.

Addressed

The isprint test is still failing. I have left a comment inline explaining why.

BTW, if you need help with building/testing your patches, let me know and I can give you few instructions. Or, you can lookup the command from the builder logs, from here for example: https://lab.llvm.org/buildbot/#/builders/78/builds/16544

libc/src/ctype/isprint.cpp
19

I think this is still incorrect. For ch - ' ', the operands get promoted to the int type making the predicate evaluate to true for c less than ' '.

Resolved all test failures

The isprint test is still failing. I have left a comment inline explaining why.

BTW, if you need help with building/testing your patches, let me know and I can give you few instructions. Or, you can lookup the command from the builder logs, from here for example: https://lab.llvm.org/buildbot/#/builders/78/builds/1654

Addressed!

gAlfonso-bit marked an inline comment as done.Aug 19 2021, 8:11 AM
sivachandra accepted this revision.Aug 23 2021, 10:49 AM

LGTM. I will test the patch one last time and submit it if everything is clean.

This revision is now accepted and ready to land.Aug 23 2021, 10:49 AM
This revision was landed with ongoing or failed builds.Aug 23 2021, 11:17 AM
This revision was automatically updated to reflect the committed changes.