Is all of that manual tracking whether a integer is signed or unsigned necessary?
The range of numbers substr accepts for its position and length offsets can be greater than the range of signed or unsigned integers.
Take a system where both IV and STRLEN are 32 bits. The range of the position and length arguments should be -2**32 .. 2**32-1 (33 bits). Even with all that complexity, only -2**31 .. 2**32 (32 bit signed or 32 bit unsigned) is accepted.
I'm all for simplifying it, but Perl doesn't currently have a type that's twice the size of IV (LONG_IV?) as far as I know. Keep in mind I wrote that under pressure since I took on the task when it was one of the last two or three 5.12 blockers. I took the easiest approach for me ("When all you have is a hammer, every problem looks like a nail.") and the one least likely to cause immediate problems.
Note that $[ is being removed shortly, so some substr will shrink (but not the bit you posted).
In reply to Re^3: [OT] LLP64 .v. LP64 portability
by ikegami
in thread [OT] LLP64 .v. LP64 portability
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |