|
From: | Paul Eggert |
Subject: | Re: [PATCH] IBM z/OS + EBCDIC support |
Date: | Tue, 22 Sep 2015 12:32:05 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
With the above in mind, it's not clear what c_isascii should do. Should it return 1 for bytes in the range 0..127, or for bytes that correspond to ASCII bytes if one assumes the standard translation from EBCDIC code page 037 to ASCII? (Is there a standard?) If the former, the current code is OK; if the latter, does the system isascii always return the same results regardless of locale and do these results make sense?
Anyway, in looking through the code I see that it's hard to test a port to EBCDIC because it uses ifdef rather than if, and I do see some promotion bugs that you noted but we can fix these with inline functions rather than macros (cleaner and safer nowadays), and there are a few other style glitches (e.g., boolean values, overuse of >=) so I installed the attached patch. This patch assumes EBCDIC control characters are either less than ' ' or are all 1 bits, which I think is right. The patch also tightens up the tests a bit.
This patch doesn't address the isascii problem, nor the "something special in z/OS" problem, so quite possibly further patches will be needed to this module.
0001-c-ctype-port-better-to-EBCDIC.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |