Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

test_concurrent_vector bug or trick ?

Blas_Rodriguez_Somoz
272 Views
Hello.

This code comes from test_concurrent_vector.cpp (tbb40_20111130):

template
void TestVectorTypes() {
tbb::concurrent_vector v;
for( int i=0; i<100; ++i ) {
// VC8 does not properly align a temporary value; to work around, use explicit variable
ClassWithVectorType foo(i);
v.push_back(foo);
for( int j=0; i
ClassWithVectorType bar(j);
ASSERT( v==bar, NULL );
}
}
}
Is the self-comparison (i
It is here at least since vers tbb30_20100406.
I found it because it throws a warning when compiling with clang.
0 Kudos
3 Replies
RafSchietekat
Valued Contributor III
272 Views
It's a bug (the test should be for j
The comment about alignment is a bit intriguing...
0 Kudos
Blas_Rodriguez_Somoz
272 Views
Yes there are more, and I'll post it in 15 minutes (more or less)

I'm not sure if gcc must throw this warning, but the others I've found are warnings that gcc missed and theoretically must throw.

0 Kudos
Anton_P_Intel
Employee
272 Views
Thank you very much for catching and reporting it.
it is definitely a bug that have to be fixed.

If you have more issues of the type you are very welcome to post it.
0 Kudos
Reply