bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] IBM z/OS + EBCDIC support


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

Thanks for looking into this. I have some questions about the c-ctype changes. It appears that the proposed patch defers to the system functions (which use the current locale), but that's not the intent of c-ctype: it's supposed to correspond to a stripped down POSIX "C" locale regardless of the current locale settings. Is there something special in z/OS that requires using the system functions? (E.g., does the "C" locale behave differently depending on some *other* setting regarding character set?)

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.

Attachment: 0001-c-ctype-port-better-to-EBCDIC.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]