bug-gnulib
[Top][All Lists]
Advanced

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

Re: IBM z/OS compatibility issues


From: Daniel Richard G.
Subject: Re: IBM z/OS compatibility issues
Date: Wed, 06 Nov 2019 09:57:24 -0500
User-agent: Cyrus-JMAP/3.1.7-509-ge3ec61c-fmstable-20191030v1

On Tue, 2019 Nov  5 17:23-05:00, Paul Eggert wrote:
> That's quite a list of compatibility issues, and I don't envy you the
> job of porting to that platform.

The necessary detective work is done; I only need help with integrating
the know-how into Gnulib. I attempted to prepare a patch to address the
duplocale() issue, for example, but could not achieve the desired
result without brute-forcing it. There appear to be subtleties that I'm
not aware of.

> One little area I may be able to help out is here:
> 
> On 11/5/19 10:03 AM, Daniel Richard G. wrote:
> 
> > * IBM XLC compiler does not support the C11 _Alignas() specifier,
> 
> I take it that the compiler defines __STDC_VERSION__ to be 201112 
> without actually supporting C11? That's annoying. Would the attached 
> Gnulib patch work around the problem for C? What would be needed for C++?

Confirmed that the compiler sets __STDC_VERSION__ == 201112 without
actually supporting that level. Note that this in fact doesn't cause a
problem for Gnulib, because _Alignas() is part of its "checking for $CC
option to enable C11 features" check, thereby causing it to fail with
"unsupported".

I experimented a bit with this, nevertheless. alignas() does not work,
but alignof() does. What leaves me scratching my head is that in
/usr/include/stdalign.h, I see the following:

    #if defined(__C1X)
      #define alignas _Alignas
      #define alignof _Alignof
      #define __alignas_is_defined 1
      #define __alignof_is_defined 1
    #endif

One aside: This kind of thing can't be conditionalized on a compiler def
alone; XLC on z/OS is AFAICT a completely different implementation from
XLC on AIX. There are many commonalities, like option syntax, but also
many points of difference that would make little sense if they came from
the same codebase. I've often had to point IBM to AIX behavior to give
them an example of "the Right(tm) way" that can't be dismissed as NIH.

If a compiler conditional is needed, I would advise

    #if defined(__MVS__) && defined(__IBMC__)

(XLC on z/OS does not appear to define __xlC__).


--Daniel


-- 
Daniel Richard G. || address@hidden
My ASCII-art .sig got a bad case of Times New Roman.



reply via email to

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