Harmony
  1. Harmony
  2. HARMONY-654

[classlib][portlib] hytty_printf("%d", -1) outputs "01"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      Ubuntu 6.06, latest classlib as of this date, IBM j9 VM for linux v3 (mkII)

      Description

      Noting as an issue so I don't forget, hytty_printf() doesn't print a "-" but rather a "0" in front of negative integers.

      I haven't traced it far enough to see where the bug is, but wanted to enter a JIRA as a reminder

        Activity

        Hide
        Mark Hindess added a comment -

        This seems to be resolved and verified.

        Show
        Mark Hindess added a comment - This seems to be resolved and verified.
        Hide
        Kelvin Ye added a comment -

        Paulex, I verified. It works fine. Thanks!

        Show
        Kelvin Ye added a comment - Paulex, I verified. It works fine. Thanks!
        Hide
        Paulex Yang added a comment -

        Kelvin, patch applied at revision r532680, thanks a lot, please verify.

        Show
        Paulex Yang added a comment - Kelvin, patch applied at revision r532680, thanks a lot, please verify.
        Hide
        Tim Ellison added a comment -

        The patch was backed-out at r531497 as it causes a compile error on Windows (which has strict warnings=>errors set up).

        Show
        Tim Ellison added a comment - The patch was backed-out at r531497 as it causes a compile error on Windows (which has strict warnings=>errors set up).
        Hide
        Vasily Zakharov added a comment -

        Paulex,

        I get the following error while building on WinXP:

        [exec] cl -c -DCRTAPI1=cdecl -DCRTAPI2=_cdecl -nologo -FIsehmap.h -D_X86=1 -DWIN32 -D_WIN32 -W3 -D_WIN95 -D_WIN32_WINDOWS=0x0400 /D_WIN32_DCOM -D_WIN32_IE=0x0500 -DWINVER=0x0400 -Zi -Od -WX -GF -Gs -MD -Zm400 -D_DLL -D_MT -D_WINSOCKAPI_ /IC:\HarmonyTrunk\working_classlib\deploy\include /IC:\HarmonyTrunk\working_classlib\deploy\jdk\include /I. -DHYPORT_LIBRARY_DEFINE /I..\shared\ -Fo..\shared\hystr.obj ..\shared\hystr.c
        [exec] hystr.c
        [exec] ..\shared\hystr.c(665) : error C2220: warning treated as error - no object file generated
        [exec] ..\shared\hystr.c(665) : warning C4018: '>' : signed/unsigned mismatch
        [exec] ..\shared\hystr.c(681) : warning C4018: '>' : signed/unsigned mismatch
        [exec] ..\shared\hystr.c(698) : warning C4018: '>' : signed/unsigned mismatch
        [exec] NMAKE : fatal error U1077: 'cl' : return code '0x2'
        [exec] Stop.

        Looks like this patch could be the cause. Have you tried rebuilding the whole build from scratch after 'ant clean'?

        Thank you!

        Show
        Vasily Zakharov added a comment - Paulex, I get the following error while building on WinXP: [exec] cl -c -DCRTAPI1= cdecl -DCRTAPI2=_cdecl -nologo -FIsehmap.h -D_X86 =1 -DWIN32 -D_WIN32 -W3 -D_WIN95 -D_WIN32_WINDOWS=0x0400 /D_WIN32_DCOM -D_WIN32_IE=0x0500 -DWINVER=0x0400 -Zi -Od -WX -GF -Gs -MD -Zm400 -D_DLL -D_MT -D_WINSOCKAPI_ /IC:\HarmonyTrunk\working_classlib\deploy\include /IC:\HarmonyTrunk\working_classlib\deploy\jdk\include /I. -DHYPORT_LIBRARY_DEFINE /I..\shared\ -Fo..\shared\hystr.obj ..\shared\hystr.c [exec] hystr.c [exec] ..\shared\hystr.c(665) : error C2220: warning treated as error - no object file generated [exec] ..\shared\hystr.c(665) : warning C4018: '>' : signed/unsigned mismatch [exec] ..\shared\hystr.c(681) : warning C4018: '>' : signed/unsigned mismatch [exec] ..\shared\hystr.c(698) : warning C4018: '>' : signed/unsigned mismatch [exec] NMAKE : fatal error U1077: 'cl' : return code '0x2' [exec] Stop. Looks like this patch could be the cause. Have you tried rebuilding the whole build from scratch after 'ant clean'? Thank you!
        Hide
        Paulex Yang added a comment -

        Kelvin, patch applied at revision r 531409 with modifications, I see no reason why these local variables use unsigned number, so I changed them to signed ones, please verify, thanks a lot.

        Show
        Paulex Yang added a comment - Kelvin, patch applied at revision r 531409 with modifications, I see no reason why these local variables use unsigned number, so I changed them to signed ones, please verify, thanks a lot.
        Hide
        Kelvin Ye added a comment -

        Would you please have a try on the patch: harmony-654.diff? Thanks very much!

        Show
        Kelvin Ye added a comment - Would you please have a try on the patch: harmony-654.diff? Thanks very much!
        Hide
        Mark Hindess added a comment -

        The problem source is in native-src/shared/port/hystr.c where many numeric formats get treated as U64/U32 rather than I64/I32. Lines like:

        case 'i':
        case 'd':
        case 'u':
        case 'x':
        case 'X':
        result->valueType[index] = tag & HYFSPEC_LL ? HYFTYPE_U64 : HYFTYPE_U32;
        break;

        Support of signed values seems to simple be missing from the implementation.

        Show
        Mark Hindess added a comment - The problem source is in native-src/shared/port/hystr.c where many numeric formats get treated as U64/U32 rather than I64/I32. Lines like: case 'i': case 'd': case 'u': case 'x': case 'X': result->valueType [index] = tag & HYFSPEC_LL ? HYFTYPE_U64 : HYFTYPE_U32; break; Support of signed values seems to simple be missing from the implementation.

          People

          • Assignee:
            Paulex Yang
            Reporter:
            Geir Magnusson Jr
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development