C++ error indicating "unable to initialize" on z/OS 1.13



Help for C/C++ for MVS, OS/390 C/C++, z/OS C/C++ and C/C++ Productivity Tools for OS/390

C++ error indicating "unable to initialize" on z/OS 1.13

Postby erra_krishna » Tue Jun 17, 2014 1:49 am

Hi all,
I 've below block of code with in a cpp file.

static const char* U_CALLCONV
ucnv_io_nextStandardAliases(UEnumeration *enumerator,
                            int32_t* resultLength,
                            UErrorCode * /*pErrorCode*/)
{
    UAliasContext *myContext = (UAliasContext *)(enumerator->context);
    uint32_t listOffset = myContext->listOffset;

    if (listOffset) {
        uint32_t listCount = gMainTable.taggedAliasLists[listOffset];
        const uint16_t *currList = gMainTable.taggedAliasLists + listOffset + 1;

        if (myContext->listIdx < listCount) {
            const char *myStr = GET_STRING(currList[myContext->listIdx++]);
            if (resultLength) {
                *resultLength = (int32_t)uprv_strlen(myStr);
            }
            return myStr;
        }
    }
    /* Either we accessed a zero length list, or we enumerated too far. */
    if (resultLength) {
        *resultLength = 0;
    }
    return NULL;
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static const UEnumeration gEnumAliases = {
    NULL,
    NULL,
    ucnv_io_closeUEnumeration,
    ucnv_io_countStandardAliases,
    uenum_unextDefault,
    ucnv_io_nextStandardAliases,  <== (Line 824)
    ucnv_io_resetStandardAliases
};
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Where UEnumeration is declared as

struct UEnumeration {
    void *baseContext;
    void *context;

    UEnumClose *close;
    UEnumCount *count;
    UEnumUNext *uNext;
    UEnumNext  *next;   <==
    UEnumReset *reset;
};

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UEnumNext is declared as

typedef const char* U_CALLCONV
UEnumNext(UEnumeration* en,
           int32_t* resultLength,
           UErrorCode* status);
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

While compiling i am getting below errors on z/OS (USS) getting below error.

Compile command:
/bin/cxx -DU_ATTRIBUTE_DEPRECATED= -DOS390BATCH -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"icudata\" -DU_COMMON_IMPLEMENTATION  -D_XOPEN_SOURCE=600  -DUCLN_NO_AUTO_CLEANUP=0 -DU_HAVE_ELF_H=1 -DU_HAVE_STD_STRING=0 -DU_HAVE_ATOMIC=0  -DU_DISABLE_RENAMING=1 -I/usr/local/ICU1510/src/source/common   "-DDEFAULT_ICU_PLUGINS=\"/usr/local/ICU1510/os-390/build/lib/icu\" "   -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)'  -+  -WI  -c -D_SHR_TZNAME -D_SHR_TIMEZONE -Wc,expo -o ucnv_io.o /usr/local/ICU1510/src/source/common/ucnv_io.cpp



Error:
"/usr/local/ICU1510/src/source/common/ucnv_io.cpp", line 824.5: CCN5257 (S) An object or reference of type "UEnumNext *" cannot be initialized with an expression of type "char *(UEnumeration *, int32_t *, UErrorCode *)".


I could see there is no mismatch in the prototypes.
Not sure why it is not getting initialized. Same code works fine on Linux/Windows OS.

Any solution/workaround for this on z/OS?

Code'd
erra_krishna
 
Posts: 2
Joined: Mon Jun 16, 2014 9:37 pm
Has thanked: 0 time
Been thanked: 0 time

Re: C++ error indicating "unable to initialize" on z/OS 1.13

Postby NicC » Fri Jun 20, 2014 2:19 pm

For a start, which is line 824.5???
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: C++ error indicating "unable to initialize" on z/OS 1.13

Postby erra_krishna » Fri Jun 20, 2014 5:06 pm

Hi,

The Line 824 is
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static const UEnumeration gEnumAliases = {
NULL,
NULL,
ucnv_io_closeUEnumeration,
ucnv_io_countStandardAliases,
uenum_unextDefault,
ucnv_io_nextStandardAliases, <== (Line 824)
ucnv_io_resetStandardAliases
};
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
erra_krishna
 
Posts: 2
Joined: Mon Jun 16, 2014 9:37 pm
Has thanked: 0 time
Been thanked: 0 time


Return to C, C++

 


  • Related topics
    Replies
    Views
    Last post