- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi! In TBB 4.4 U3, the file enumerable_thread_specific.h contains a class "ets_base" with an inner struct "ets_base::array".
This ets_base::array struct has a method size() implemented using a bit-shift operation:
size_t size() const { return (size_t)1 << lg_size; }
The (size_t) cast on the literal number 1 ensures that the bit-shift operation is adapted according to 32-bit and 64-bit builds. (The bit-shift operator uses the type of the left operand.)
However, in the methods ets_base::allocate() and ets_base::free() a similar bit-shift appears but without the (size_t) cast on the literal number 1. When compiling in VS2015 Update 2 RTM (just released) these two methods give the following warning:
Warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
(See https://msdn.microsoft.com/en-us/library/ke55d167.aspx for more info on this warning.)
This warning can easily be removed by simply adding the same (size_t) cast as in the ets_base::array::size() method.
Thanks, Göran Wallgren.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Forgot to mention that the warning appears in 64-bit build...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page