Bug#382153: Compiling line
I had submitted two testcases to show the problem in the stdc++ library,
but I forgot to add that this bug only turns up with a certain warning
activated:
marga@merulo:~/testcase$ g++ -Wcast-align -o foo doesnt-work.cpp
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:
In member function 'std::basic_string<_CharT, _Traits, _Alloc>::_Rep*
std::basic_string<_CharT, _Traits, _Alloc>::_M_rep() const [with _CharT =
char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:478:
instantiated from 'std::basic_string<_CharT, _Traits,
_Alloc>::~basic_string() [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]'
doesnt-work.cpp:6: instantiated from here
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:283:
warning: cast from 'char*' to 'std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::_Rep*' increases required
alignment of target type
So, the problem happens only if you activate the -Wcast-align warnings.
Also, this problem is turning up in alpha, arm, hppa and sparc, so it's not
really an ia64 specific problem.
I've been trying to read the C++ code that leads to this problem, but I was
unable to find anything useful. Sorry.
--
Bezos, (o.
Marga. (/)_
Reply to: