[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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

marga@merulo:~/testcase$ g++ -Wcast-align -o foo doesnt-work.cpp
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>]':
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
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: