This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [[patch] valarray (was Re: valarray_copy implementation question)


If you want a complete example of how this is used this you can check the example 14-22 at http://www.linux-kheops.com/doc/casteyde/cours_cpp-1.40.1/htm/x5866.htm#AEN6045

that segfaults with g++

because the computed assignment is between a source and a destination that have different sizes. It's a user error so easy to step into I guess. The Standard didn't make this point very intuitive.

Cheers

Christian


Gabriel Dos Reis wrote:
On Fri, Nov 27, 2009 at 3:02 AM, Christian BRUEL <christian.bruel@st.com> wrote:
Now that you established that it was a user bug, just wanted to slightly
correct the problem characterization by fixing the code with

 b[0] = foo();
 dest[b] = src[b];

so the problem was the "this" size really, not the runtime dependency on
foo(). Hope this could be of interest (regarding all the bogus examples I
found including the computed assignment variation).

Are you still having a problem with that? If yes, could you send a minimal complete program?

-- Gaby



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]