Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6733976
Votes 0
Synopsis VS2008 errors compiling AWT files - explicit casts need to be added
Category java:classes_awt
Reported Against
Release Fixed 7(b48)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 6585765
Submit Date 05-AUG-2008
Description
The Visual Studio 2008 compiler has strict type checking, and the build is failing in AWT with errors like this:

C:/PROGRA~1/MICROS~1.0/VC/bin/cl  -O2 -Zi -nologo -MD /D _STATIC_CPPLIB  -Fdg:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/obj/awt_Button.pdb -Fmg:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/obj/awt_Button.map -W3 -DD3D_OVERLOADS -EHsc -DUNICODE -D_UNICODE  -DWIN32 -DIAL -D_LITTLE_ENDIAN -DWIN32 -D_X86_ -Dx86  -DWIN32_LEAN_AND_MEAN -I. -Ig:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/CClassHeaders -I../../../src/windows/javavm/export -I../../../src/share/javavm/export -I../../../src/share/javavm/include -I../../../src/windows/javavm/include -I../../../src/share/native/common -I../../../src/windows/native/common -I../../../src/share/native/sun/awt -I../../../src/windows/native/sun/awt -Ig:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/CClassHeaders/../../java/jvm -Ig:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/obj -I../../../src/share/native/common -I../../../src/windows/native/sun/windows -Ic:/PROGRA~1/MICROS~1.0SD/Include -I../../../src/share/native/sun/awt/image/cvutils -I../../../src/share/native/sun/awt/image -I../../../src/share/native/sun/java2d/loops -I../../../src/share/native/sun/java2d -I../../../src/windows/native/sun/java2d -I../../../src/share/native/sun/java2d/opengl -I../../../src/windows/native/sun/java2d/d3d -I../../../src/windows/native/sun/java2d/opengl -I../../../src/windows/native/sun/java2d/windows -I../../../src/share/native/sun/font -I../../../src/share/native/sun/java2d/pipe -I../../../src/share/native/sun/dc/path -I../../../src/share/native/sun/dc/doe -I../../../src/share/native/sun/awt/debug -I../../../src/windows/native/sun/awt  -I../../../src/share/native/sun/awt/medialib   -DINTERNAL_BUILD  -c -Fog:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/obj/awt_Button.obj  ../../../src/windows/native/sun/windows/awt_Button.cpp
awt_Button.cpp
../../../src/windows/native/sun/windows/awt_Button.cpp(109) : error C2440: '=' : cannot convert from 'const jchar *' to 'LPCWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
../../../src/windows/native/sun/windows/awt_Button.cpp(131) : error C2664: 'JNIEnv_::ReleaseStringChars' : cannot convert parameter 2 from 'LPCWSTR' to 'const jchar *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
../../../src/windows/native/sun/windows/awt_Button.cpp(336) : error C2440: '=' : cannot convert from 'const char *' to 'LPCTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
../../../src/windows/native/sun/windows/awt_Button.cpp(343) : error C2664: 'JNU_ReleaseStringPlatformChars' : cannot convert parameter 3 from 'LPCTSTR' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
make[4]: *** [g:/tbell/6523947/build/windows-i586/tmp/sun/sun.awt/awt/obj/awt_Button.obj] Error 2
make[4]: Leaving directory `/cygdrive/g/tbell/6523947/jdk/make/sun/awt'
make[3]: *** [all] Error 1
make[3]: Leaving directory `/cygdrive/g/tbell/6523947/jdk/make/sun'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/cygdrive/g/tbell/6523947/jdk/make'
make[1]: *** [jdk-build] Error 2
make[1]: Leaving directory `/cygdrive/g/tbell/6523947'
make: *** [product_build] Error 2


See attached file 'product_build.log' for the full build.



I will add a list of files and the suggested fixes when I have collected everything in AWT.
Posted Date : 2008-08-05 21:35:43.0
Work Around
N/A
Evaluation
I have already fixed most of the places with conversion for LPWSTR, LPCWSTR, LPTSTR, LPCTSTR, jchar* and other types is required. The rest are in progress.
Posted Date : 2008-08-06 08:15:18.0

Fixed with 6585765.
Posted Date : 2008-08-26 09:17:11.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang