AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
Expand all | Collapse all

Problem with exceptions on GCC 4.2.4

  • 1.  Problem with exceptions on GCC 4.2.4

    Posted Mon February 23, 2009 09:27 AM

    Originally posted by: SystemAdmin


    Hi,

    When i'm compiling the following program:

    #include <stdio.h>

    int main()
    {
    try {
    printf ("lior\n");
    throw "lior";
    }
    catch (...) {
    printf ("exception caught...\n");
    }
    return 1;
    }

    I'm getting the follwoing error:

    lior
    terminate called after throwing an instance of 'char*'
    IOT/Abort trap

    The compilation command I used is:

    gcc testaix61.cpp /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/libstdc++.a

    Does anyone knows what causes the problem?

    Thank you!
    Lior
    #AIX-Forum


  • 2.  Re: Problem with exceptions on GCC 4.2.4

    Posted Mon February 23, 2009 09:30 AM

    Originally posted by: SystemAdmin


    Hi,

    One more thing, I'm using the following environment:
    AIX 6.1

    gcc-4.2.4-1.aix6.1.ppc.rpm
    gcc-c++-4.2.4-1.aix6.1.ppc.rpm
    gcc-cpp-4.2.4-1.aix6.1.ppc.rpm
    info-4.6-1.aix5.1.ppc.rpm
    libgcc-4.2.4-1.aix6.1.ppc.rpm
    libgomp-4.2.4-1.aix6.1.ppc.rpm
    libstdc++-4.2.4-1.aix6.1.ppc.rpm
    libstdc++-devel-4.2.4-1.aix6.1.ppc.rpm

    Thanks,
    Lior
    #AIX-Forum