
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Sun C++ +w, wide mode (-xarch=amd64, -xarch=sparcv9, or -m64)
|
|
Issue Links:
|
Reference
|
|
This issue relates to:
|
|
STDCXX-550
[Sun C++] 64-bit conversion warnings building utilities
|
|
|
|
|
|
|
|
| Severity: |
Compiler Warning
|
| Resolution Date: |
17/Sep/07 11:59 PM
|
We get a bunch of 64-bit conversion warnings when building the library in wide (64-bit) mode with Sun C++ 5.8 and 5.9:
gmake: Entering directory `$(BUILDDIR)/lib'
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/assert.cpp
...
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/locale_core.cpp
"$(TOPDIR)/src/locale_core.cpp", line 141: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/locale_core.cpp", line 141: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
2 Warning(s) detected.
...
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/num_get.cpp
"$(TOPDIR)/src/num_get.cpp", line 432: Warning, truncwarn: Conversion of 64 bit type value to "unsigned" causes truncation.
"$(TOPDIR)/src/num_get.cpp", line 461: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
2 Warning(s) detected.
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/num_put.cpp
"$(TOPDIR)/src/num_put.cpp", line 417: Warning, truncwarn: Conversion of 64 bit type value to "const int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 417: Warning, truncwarn: Conversion of 64 bit type value to "const int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 745: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 772: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 802: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 830: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
6 Warning(s) detected.
...
CC -xar -o libstd.a assert.o atomic-cxx.o bitset.o catalog.o codecvt.o collate.o ctype.o ctype_bits.o domain_error.o exception.o export.o facet.o file.o instance.o ios.o ios_bits.o iostore.o iostream.o iso2022.o limits.o limits_bits.o locale_bits.o locale_body.o locale_classic.o locale_combine.o locale_core.o locale_eq.o locale_global.o locale_name.o logic_error.o memattr.o memory.o messages.o mman.o num_get.o num_put.o once.o punct.o random.o range_error.o runtime_error.o setlocale.o string.o strstream.o strtol.o ti_collate.o ti_filebuf.o ti_insert_dbl.o ti_insert_int.o ti_insert_ptr.o ti_ios.o ti_istream.o ti_messages.o ti_money_get.o ti_money_put.o ti_moneypunct.o ti_num_get.o ti_num_put.o ti_numpunct.o ti_ostream.o ti_podarray.o ti_streambuf.o ti_string.o ti_stringbuf.o ti_time_get.o ti_time_put.o ti_wcollate.o ti_wfilebuf.o ti_winsert_dbl.o ti_winsert_int.o ti_winsert_ptr.o ti_wios.o ti_wistream.o ti_wmessages.o ti_wmoney_get.o ti_wmoney_put.o ti_wmoneypunct.o ti_wnum_get.o ti_wnum_put.o ti_wnumpunct.o ti_wostream.o ti_wstreambuf.o ti_wstring.o ti_wstringbuf.o ti_wtime_get.o ti_wtime_put.o time_get.o time_put.o tmpbuf.o typeinfo.o valarray.o vecbool.o version.o wcodecvt.o wctype.o
gencat rwstderr.cat $(TOPDIR)/src/rwstderr.msg
gmake: Leaving directory `$(BUILDDIR)/lib'
|
|
Description
|
We get a bunch of 64-bit conversion warnings when building the library in wide (64-bit) mode with Sun C++ 5.8 and 5.9:
gmake: Entering directory `$(BUILDDIR)/lib'
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/assert.cpp
...
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/locale_core.cpp
"$(TOPDIR)/src/locale_core.cpp", line 141: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/locale_core.cpp", line 141: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
2 Warning(s) detected.
...
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/num_get.cpp
"$(TOPDIR)/src/num_get.cpp", line 432: Warning, truncwarn: Conversion of 64 bit type value to "unsigned" causes truncation.
"$(TOPDIR)/src/num_get.cpp", line 461: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
2 Warning(s) detected.
CC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -library=%none -g -xarch=amd64 +w -errtags -erroff=hidef $(TOPDIR)/src/num_put.cpp
"$(TOPDIR)/src/num_put.cpp", line 417: Warning, truncwarn: Conversion of 64 bit type value to "const int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 417: Warning, truncwarn: Conversion of 64 bit type value to "const int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 745: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 772: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 802: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
"$(TOPDIR)/src/num_put.cpp", line 830: Warning, truncwarn: Conversion of 64 bit type value to "int" causes truncation.
6 Warning(s) detected.
...
CC -xar -o libstd.a assert.o atomic-cxx.o bitset.o catalog.o codecvt.o collate.o ctype.o ctype_bits.o domain_error.o exception.o export.o facet.o file.o instance.o ios.o ios_bits.o iostore.o iostream.o iso2022.o limits.o limits_bits.o locale_bits.o locale_body.o locale_classic.o locale_combine.o locale_core.o locale_eq.o locale_global.o locale_name.o logic_error.o memattr.o memory.o messages.o mman.o num_get.o num_put.o once.o punct.o random.o range_error.o runtime_error.o setlocale.o string.o strstream.o strtol.o ti_collate.o ti_filebuf.o ti_insert_dbl.o ti_insert_int.o ti_insert_ptr.o ti_ios.o ti_istream.o ti_messages.o ti_money_get.o ti_money_put.o ti_moneypunct.o ti_num_get.o ti_num_put.o ti_numpunct.o ti_ostream.o ti_podarray.o ti_streambuf.o ti_string.o ti_stringbuf.o ti_time_get.o ti_time_put.o ti_wcollate.o ti_wfilebuf.o ti_winsert_dbl.o ti_winsert_int.o ti_winsert_ptr.o ti_wios.o ti_wistream.o ti_wmessages.o ti_wmoney_get.o ti_wmoney_put.o ti_wmoneypunct.o ti_wnum_get.o ti_wnum_put.o ti_wnumpunct.o ti_wostream.o ti_wstreambuf.o ti_wstring.o ti_wstringbuf.o ti_wtime_get.o ti_wtime_put.o time_get.o time_put.o tmpbuf.o typeinfo.o valarray.o vecbool.o version.o wcodecvt.o wctype.o
gencat rwstderr.cat $(TOPDIR)/src/rwstderr.msg
gmake: Leaving directory `$(BUILDDIR)/lib' |
Show » |
|
file.cpp
$(TOPDIR)\src\file.cpp(484) : warning C4244: 'argument' : conversion from '__int64' to 'long', possible loss of data
$(TOPDIR)\src\file.cpp(493) : warning C4244: 'argument' : conversion from '__int64' to 'long', possible loss of data
$(TOPDIR)\src\file.cpp(508) : warning C4244: 'argument' : conversion from 'unsigned __int64' to 'unsigned int', possible loss of data
$(TOPDIR)\src\file.cpp(523) : warning C4244: 'argument' : conversion from 'unsigned __int64' to 'unsigned int', possible loss of data
locale_core.cpp
$(TOPDIR)\src\locale_core.cpp(141) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
num_put.cpp
$(TOPDIR)\src\num_put.cpp(745) : warning C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
$(TOPDIR)\src\num_put.cpp(772) : warning C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
$(TOPDIR)\src\num_put.cpp(802) : warning C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
$(TOPDIR)\src\num_put.cpp(830) : warning C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
ti_num_get.cpp
$(TOPDIR)\include\loc/_punct.cc(90) : warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
$(TOPDIR)\include\loc/punct.h(143) : see reference to function template instantiation 'rw::rw_istreambuf_iterator __rw::_rw_match_name<char,std::istreambuf_iterator<_CharT,_Traits>>(std::istreambuf_iterator<_CharT,_Traits>,std::istreambuf_iterator<_CharT,_Traits>,const char *const *,const unsigned __int64 *,unsigned __int64,unsigned __int64 &,int &,std::ios_base *)' being compiled
with
[
_CharT=char,
_Traits=std::char_traits<char>
]
ti_wnum_get.cpp
$(TOPDIR)\include\loc/_punct.cc(90) : warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
$(TOPDIR)\include\loc/punct.h(150) : see reference to function template instantiation 'rw::rw_wistreambuf_iterator __rw::_rw_match_name<wchar_t,std::istreambuf_iterator<_CharT,_Traits>>(std::istreambuf_iterator<_CharT,_Traits>,std::istreambuf_iterator<_CharT,_Traits>,const wchar_t *const *,const unsigned __int64 *,unsigned __int64,unsigned __int64 &,int &,std::ios_base *)' being compiled
with
[
_CharT=wchar_t,
_Traits=std::char_traits<wchar_t>
]
$(TOPDIR)\include\loc/_punct.cc(90) : warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
$(TOPDIR)\include\loc/num_get.cc(218) : see reference to function template instantiation '_InputIter __rw::_rw_match_name<char,std::istreambuf_iterator<_CharT,_Traits>>(_InputIter,_InputIter,const _CharT *const *,const unsigned __int64 *,unsigned __int64,unsigned __int64 &,int &,std::ios_base *)' being compiled
with
[
_InputIter=std::istreambuf_iterator<char,std::char_traits<char>>,
_CharT=char,
_Traits=std::char_traits<char>
]
$(TOPDIR)\include\loc/num_get.cc(172) : while compiling class template member function 'std::istreambuf_iterator<_CharT,_Traits> std::num_get<_CharT,_InputIter>::do_get(std::istreambuf_iterator<_CharT,_Traits>,std::istreambuf_iterator<_CharT,_Traits>,std::ios_base &,rw::_rw_iostate &,bool &) const'
with
[
_CharT=char,
_Traits=std::char_traits<char>,
_InputIter=std::istreambuf_iterator<char,std::char_traits<char>>
]
$(TOPDIR)\include\loc/_locale.h(346) : see reference to class template instantiation 'std::num_get<_CharT,_InputIter>' being compiled
with
[
_CharT=char,
_InputIter=std::istreambuf_iterator<char,std::char_traits<char>>
]
$(TOPDIR)\include\loc/locale.h(88) : see reference to function template instantiation 'const __rw::rw_facet *rw::_rw_get_facet<_Facet>(const std::locale &,const _Facet *)' being compiled
with
[
_Facet=std::numpunct<wchar_t>
]
$(TOPDIR)\include\loc/_num_get.cc(196) : see reference to function template instantiation 'const _Facet &std::use_facet<std::numpunct<_CharT>>(const std::locale &)' being compiled
with
[
_Facet=std::numpunct<wchar_t>,
_CharT=wchar_t
]
$(TOPDIR)\include\loc/num_get.cc(172) : while compiling class template member function 'std::istreambuf_iterator<_CharT,_Traits> std::num_get<_CharT,_InputIter>::do_get(std::istreambuf_iterator<_CharT,_Traits>,std::istreambuf_iterator<_CharT,_Traits>,std::ios_base &,rw::_rw_iostate &,bool &) const'
with
[
_CharT=wchar_t,
_Traits=std::char_traits<wchar_t>,
_InputIter=std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>
]
$(TOPDIR)\include\loc/_num_get.h(276) : see reference to class template instantiation 'std::num_get<_CharT,_InputIter>' being compiled
with
[
_CharT=wchar_t,
_InputIter=std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>
]