This is an archive of the discontinued LLVM Phabricator instance.

[count] Use correct integral type
ClosedPublic

Authored by gAlfonso-bit on May 21 2022, 9:55 AM.

Details

Summary

This was done by making the types consistent with each other, and returning an unsigned long instead of a long int.

Diff Detail

Event Timeline

gAlfonso-bit created this revision.May 21 2022, 9:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 9:55 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
gAlfonso-bit requested review of this revision.May 21 2022, 9:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 9:55 AM

Where is the undefined behavior? size_t is unsigned long long on 32-bit ELF platforms. You need %zu.

MaskRay requested changes to this revision.May 21 2022, 11:11 AM
This revision now requires changes to proceed.May 21 2022, 11:11 AM
gAlfonso-bit retitled this revision from Remove undefined behavior in count.c test program [NFC] to [NFC] Remove undefined behavior in count.c test program.

Updated @MaskRay

MaskRay accepted this revision.Dec 6 2022, 11:51 AM
This revision is now accepted and ready to land.Dec 6 2022, 11:51 AM

[NFC]

There is a difference so this is not NFC.

MaskRay retitled this revision from [NFC] Remove undefined behavior in count.c test program to [NFC] Use correct integral type.Dec 6 2022, 11:51 AM
MaskRay retitled this revision from [NFC] Use correct integral type to [count] Use correct integral type.
This comment was removed by gAlfonso-bit.

Ok, but it works the same even if the generated asm is different. Plus, I do not have commit perms, so you can use gfunni234@gmail.com as the committer email address @MaskRay

Thanks for the email address. Do you have a preferred name used in git commit --amend --author='name <email>'?

This comment was removed by gAlfonso-bit.
This revision was landed with ongoing or failed builds.Dec 6 2022, 3:30 PM
This revision was automatically updated to reflect the committed changes.