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

concurrent_vector compiler warning

mgmt1969
Beginner
170 Views
Hi all,

I am getting a compiler warning when making calls to concurrent_vector::shrink_to_fit with MSVC9:

warning C4701: potentially uninitialized local variable 'old' used concurrent_vector.h 908

I can make this easily go away with #pragma warning (disable: 4701) but I think it would be better if the warning was not generated in the first place.

Cheers,
manuel

PS: Forgot to mention that I am using warning level 4 (/W4), which is the highest level.

0 Kudos
1 Reply
Alexey-Kukanov
Employee
170 Views
Strangely, we do not see it in tests, though we also use /W4. Maybe some other compilation options interfere. I will put warning suppression pragmas around the function definition, but Iam unable to test whether it helps.

And by the way, the warning is a "false positive"; as often, compiler is unable to figure out that the variable is initialized at the points of use.
Reply