- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page