Adjust shift-right operator for next and subsequent release
Bug #1608505 reported by
Thorsten Glaser
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mksh |
Fix Released
|
High
|
Thorsten Glaser |
Bug Description
We’re renaming the rotation operators from <<< (ROL) and >>> (ROR) to ^< (ROL) and ^> (ROR) to make space for >>> as another right-shift operator, to be able to map both SHR and SAR into shell, and for (as izabera requested) better consistency wrt. other languages.
Unfortunately, for the languages separating this operator, the mapping is as follows:
• SHL <<
• SHR >>>
• SAR >>
For C, >> is SAR for signed types and SHR for unsigned types. In POSIX, arithmetics are always signed and use C semantics.
Therefore, R53 will document >> is to be renamed into >>> as SHR, and R54 will do that and newly introduce >> as SAR operator. (This is consistent with the $KSH_VERSION bump already done.)
Changed in mksh: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Thorsten Glaser (mirabilos) |
Changed in mksh: | |
status: | Triaged → Fix Released |
To post a comment you must log in.
… eh, nōnsense.
We can already switch between signed and unsigned,
so >> is enough for us, to act as both SAR (by default)
and SHR (if the op is unsigned).