bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Daniel Richard G." <skunk@iSKUNK.ORG>, bug-gnulib@gnu.org
Subject: Re: [PATCH] IBM z/OS + EBCDIC support
Date: Tue, 22 Sep 2015 09:23:34 -0600	[thread overview]
Message-ID: <56017276.3090100@redhat.com> (raw)
In-Reply-To: <1442888927.2328038.389926169.50DB0133@webmail.messagingengine.com>

[-- Attachment #1: Type: text/plain, Size: 3950 bytes --]

On 09/21/2015 08:28 PM, Daniel Richard G. wrote:
> Hello list,
> 
> The attached patch, against Git master, addresses numerous
> incompatibilities in Gnulib with IBM z/OS (a mainframe operating system)
> and the EBCDIC encoding.
> 
> With my changes, Gnulib builds successfully, and most of the tests
> succeed. The remaining failures are as follows.

Thanks for the work. Can you please split the patch into a series of
multiple pieces, one patch per issue, so that we can apply the
obviously-correct ones while still discussing the other pieces, rather
than holding the entire large patch hostage to review?

Also, while I see you have copyright assignment on file for Gawk, I
don't see it for gnulib. You'll want to repeat the assignment process
for gnulib before we can take more than the most trivial patches.

Some quick comments, without having reviewed any code:

> 
> * In EBCDIC, normal chars like 'A' occur in the upper half of the 8-bit
>   range. This interferes with the idiom of using "switch (c)" and then
>   "case 'A':" et al. because c can have two distinct values (-63 and
>   193) that should match to 'A'.
> 
>   My fix, then, is a macro which converts the input codepoint to the
>   range that will match literal chars, when necessary. (Obviously, in
>   ASCII, it's a no-op.) Any takers on a better name for this macro than
>   CHAR_LITERAL()?

coreutils uses to_uchar() to force the conversion of a byte to an
unsigned character, useful for cases where sign extension of a byte is
not desired.  Sounds like it does the same thing as what you are doing here.


> +++ lib/math.in.h
> 
> * The system defines these functions as macros, and the compiler did not
>   like seeing them redefined.

No underlying functions with linkage? POSIX generally requires that, so
you may want to submit a bug, but it's certainly not the first time
we've worked around that.

> 
> +++ lib/regex.h
> 
> * Ensure that "__string" does not expand to "1" when it is used as a
>   formal parameter name.

Sounds like we shouldn't be naming our formal parameter __string, since
that's a name reserved to the internal implementation namespace.

> 
> +++ m4/strstr.m4
> 
> * The IBM runtime sucks; signal delivery is delayed until strstr()
>   exits, so this test results in a hang that can only be SIGKILL'ed.

Not a hang, just a reallllllly long execution time; and all because the
libc implementation is O(n^2) instead of O(n).  But they really block
signals during the call?  Ouch.


> +++ tests/nan.h
> 
> * z/OS, in addition to supporting IEEE floating-point, also supports an
>   older "hexadecimal" format that does not support NaN. Bomb out if this
>   is in use.

C, and POSIX, allow for platforms without NaN (in part because of cases
like the z/OS non-IEEE mode).  I'm not surprised if we have baked in
assumptions that don't hold when IEEE is not around.

> +++ tests/test-c-strcasecmp.c
> 
> * In EBCDIC-1047, the tests
> 
>     ASSERT (c_strcasecmp ("turkish", "TURK\304\260SH") < 0);
>     ASSERT (c_strcasecmp ("TURK\304\260SH", "turkish") > 0);
> 
>   are actually
> 
>     ASSERT (c_strcasecmp ("turkish", "TURKD¬SH") < 0);
>     ASSERT (c_strcasecmp ("TURKD¬SH", "turkish") > 0);
> 
>   which, of course, fail.

Basically, EBCDIC lacks the Turkish i, and since it is not a UTF-8
locale, we should probably be skipping the test in that environment.

> +++ tests/test-canonicalize-lgpl.c
> 
> * Addressed a strange z/OS corner case. This system has
>   DOUBLE_SLASH_IS_DISTINCT_ROOT, yet the dev/ino numbers are the same.

What? Does that mean 'ls -a /' and 'ls -a //' see different contents?
If they do, then sharing dev/ino is a bug; if they are identical, then
DOUBLE_SLASH_IS_DISTINCT_ROOT is defined incorrectly.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-09-22 15:23 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22  2:28 [PATCH] IBM z/OS + EBCDIC support Daniel Richard G.
2015-09-22 15:23 ` Eric Blake [this message]
2015-09-22 19:27   ` Daniel Richard G.
2015-09-22 20:00     ` Paul Eggert
2015-09-22 20:08       ` Eric Blake
2015-09-22 20:51         ` Daniel Richard G.
2015-09-22 19:32 ` Paul Eggert
2015-09-22 19:46   ` Paul Eggert
2015-09-22 20:37   ` Daniel Richard G.
2015-09-22 22:03     ` Paul Eggert
2015-09-22 23:44       ` Daniel Richard G.
2015-09-23  2:02         ` Paul Eggert
2015-09-23  6:58           ` Daniel Richard G.
2015-09-23 19:05             ` Paul Eggert
2015-09-23 19:29             ` Paul Eggert
2015-09-23 21:57               ` Daniel Richard G.
2015-09-25  7:29                 ` Paul Eggert
2015-09-26  0:25                   ` Daniel Richard G.
2015-09-26  2:49                     ` Paul Eggert
2015-09-26  4:39                       ` Daniel Richard G.
2015-09-26 16:08                         ` Ben Pfaff
2015-09-27  6:31                           ` Daniel Richard G.
2015-09-27  6:59                             ` Paul Eggert
2015-09-28  2:09                               ` Daniel Richard G.
2015-10-15  4:49                               ` Daniel Richard G.
2016-08-18  0:47                                 ` Paul Eggert
2016-08-18  8:24                                   ` Daniel Richard G.
2016-08-18  8:53                                     ` Paul Eggert
2016-08-19  8:20                                       ` Daniel Richard G.
2016-08-19 11:03                                         ` Bruno Haible
2016-08-19 19:28                                         ` Paul Eggert
2016-08-19 20:38                                           ` Daniel Richard G.
2019-12-19  4:57                                 ` z/OS configure triple Bruno Haible
2019-12-20  0:22                                   ` Daniel Richard G.
2019-12-20  6:29                                     ` Bruno Haible
2019-12-19  5:16                                 ` z/OS, iconv, and charset aliases Bruno Haible
2019-12-19  5:21                                   ` Bruno Haible
2019-12-20  4:38                                   ` Daniel Richard G.
2019-12-20  8:19                                     ` Bruno Haible
2019-12-20 18:23                                       ` Daniel Richard G.
2019-12-21  5:49                                         ` z/OS, iconv, and gperf Bruno Haible
2020-01-09  5:48                                           ` Daniel Richard G.
2020-01-19 21:52                                             ` Bruno Haible
2020-01-19 21:59                                             ` Bruno Haible
2020-01-19 22:32                                               ` Daniel Richard G.
2020-01-20  0:13                                                 ` Bruno Haible
2020-01-22  6:38                                                   ` Daniel Richard G.
2015-09-22 19:50 ` [PATCH] IBM z/OS + EBCDIC support Paul Eggert
2015-09-22 20:47   ` Daniel Richard G.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56017276.3090100@redhat.com \
    --to=eblake@redhat.com \
    --cc=bug-gnulib@gnu.org \
    --cc=skunk@iSKUNK.ORG \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).