Issue Details (XML | Word | Printable)

Key: STDCXX-781
Type: Sub-task Sub-task
Status: Open Open
Priority: Minor Minor
Assignee: Martin Sebor
Reporter: Scott (Yu) Zhong
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library
STDCXX-726

[HP aCC 6.16] out of bound warnings 20206 and 20208 in 23.bitset.cons.stdcxx-297.cpp

Created: 17/Mar/08 07:09 PM   Updated: 22/Apr/08 09:34 PM
Return to search
Component/s: 21. Strings
Affects Version/s: 4.2.0
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 2h
Remaining Estimate - 2h
Time Spent: Not Specified
Remaining Estimate - 2h

Environment:
$ uname -sr && aCC -V
HP-UX B.11.31
aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
Issue Links:
Cloners


 Description  « Hide
When compiled with HP aCC 6.16 with +w +O, the test 23.bitset.cons.stdcxx-297.cpp produces the following warning out of the _traits.h header:
aCC -c -I$(TOPDIR)/include -I$(BUILDDIR)/include -I$(TOPDIR)/tests/include  -AA  +O2  +DD64 +w \
    +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2340 +W2401 +W2487 +W4227 \
    +W4229 +W4231 +W4235 +W4237 +W4249 +W4255 +W4272 +W4284 +W4285 +W4286 +W4296 +W4297 +W3348 \
    $(TOPDIR)/tests/regress/23.bitset.cons.stdcxx-297.cpp
"$(TOPDIR)/include/string", line 842: warning #4232-D: conversion from "int *" to a more strictly aligned type "__rw::__string_ref<int, std::char_traits<int>, std::allocator<int>> *" may cause misaligned access
          return _RWSTD_REINTERPRET_CAST (_C_string_ref_type*, _C_data) - 1; 
                 ^
          detected during:
            instantiation of "__rw::__string_ref<_Traits::char_type, _Traits, _Allocator> *std::basic_string<_CharT, _Traits, _Allocator>::_C_pref() const [with _CharT=int, _Traits=std::char_traits<int>, _Allocator=std::allocator<int>]" at line 899
            instantiation of "void std::basic_string<_CharT, _Traits, _Allocator>::_C_unlink(_Allocator::pointer) [with _CharT=int, _Traits=std::char_traits<int>, _Allocator=std::allocator<int>]" at line 198
            instantiation of "std::basic_string<_CharT, _Traits, _Allocator>::~basic_string() [with _CharT=int, _Traits=std::char_traits<int>, _Allocator=std::allocator<int>]" at line 42 of "$(TOPDIR)/tests/regress/23.bitset.cons.stdcxx-297.cpp"

"$(TOPDIR)/include/rw/_traits.h", line 333, procedure main: warning #20208-D: Forming out of bound address (In expression "(const int*)(&(&std::basic_string<int, std::char_traits<int>, std::allocator<int>>::_C_null_ref)-><compiler generated undef>_0+1)+1", &(&std::basic_string<int, std::char_traits<int>, std::allocator<int>>::_C_null_ref)-><compiler generated undef>_0+1 (type: struct __rw::__string_ref<std::basic_string<int, std::char_traits<int>, std::allocator<int>>::value_type, std::basic_string<int, std::char_traits<int>, std::allocator<int>>::traits_type, std::basic_string<int, std::char_traits<int>, std::allocator<int>>::allocator_type> ) (defined by &(&std::basic_string<int, std::char_traits<int>, std::allocator<int>>::_C_null_ref)-><compiler generated undef>_0) has byte range [0 .. 23], forming address byte range [28 .. 31].)

"$(TOPDIR)/include/rw/_traits.h", line 314, procedure main: warning #20206-D: Out of bound access (In expression "&(&std::basic_string<int, std::char_traits<int>, std::allocator<int>>::_C_null_ref)-><compiler generated undef>_0+1", &(&std::basic_string<int, std::char_traits<int>, std::allocator<int>>::_C_null_ref)-><compiler generated undef>_0 (type: struct __rw::__string_ref<std::basic_string<int, std::char_traits<int>, std::allocator<int>>::value_type, std::basic_string<int, std::char_traits<int>, std::allocator<int>>::traits_type, std::basic_string<int, std::char_traits<int>, std::allocator<int>>::allocator_type> ) has byte range [0 .. 23], reading byte range [24 .. 47].)


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 25/Mar/08 02:19 AM
Added context, including the command line, to the Description.
Set the correct Component/s.

Martin Sebor added a comment - 22/Apr/08 09:34 PM
This is specific to the 23.bitset.cons.stdcxx-297.cpp regression test which for some reason uses the std::basic_string<char> specialization.
Updated Summary, lowered Priority to Minor, and deferred until 4.2.2.