AIX

AIX

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


#Power
 View Only
Expand all | Collapse all

compile error aqfter upgrade AIX51 to AIX5.3

  • 1.  compile error aqfter upgrade AIX51 to AIX5.3

    Posted Wed September 03, 2008 12:27 AM

    Originally posted by: SystemAdmin


    We upgrade the operating system from AIX5.1 to AIX5.3
    and Oracle9 to Oracle10g.

    On compiling ProC files, we got 2 kinds of error/warning messages:-

    (1)
    Source Code:=
    char rec_type[4];
    char in_string1000;
    strncpy(rec_type,in_string,3);
    rec_type[3]='\0'; => This is line 2815

    Error Message:- "360_Main.pc", line 2815.16: 1506-1298 (W) The subscript 3 is out of range. The valid range is 0 to 2.

    But we declare rec_type as rec_type[4].
    (2)

    Source Code:-

    int bytecount;
    size_t maxbytestoread

    if (bytecount == maxbytestoread)

    This line gives error/warning:-
    "ASXReuterMain.pc", line 430.45: 1506-743 (I) 64-bit portability: possible change of result through conversion of int type into unsigned long int type.

    rv = maxbytestoread + 1;

    This lines gives error/warning:-
    "ASXReuterMain.pc", line 432.45: 1506-742 (I) 64-bit portability: possible loss of digits through conversion of unsigned long int type into int type.

    There are tons of the error/warning messages in the build process -
    "possible loss of digits through conversion of unsigned long int type into int type"

    Is there a way to get rid of these error/warning messages.

    Thanks for assistance
    #AIX-Forum


  • 2.  Re: compile error aqfter upgrade AIX51 to AIX5.3

    Posted Mon September 08, 2008 08:53 AM

    Originally posted by: nagger


    Hang on these are genuine errors in your code and perhaps the improved compilers are highlighting more errors
    • this is normally seen as a good thing.

    char in_string1000;
    is one character long and you are trying to more 3 bytes - OK the error is not clear.

    You are also comparing variables that are different numbers of bits.
    You need to cast one variable or the other so that match and to tel the compiler you know what you are doing.

    Just ignoring errors in your code does not sound like a good idea to me - much better fix your code or remove ambiguous code.

    ta Nigel
    #AIX-Forum