[PATCH] D22971: [libcxx] [test] Fix an MSVC x64 compiler warning.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 29 12:54:22 PDT 2016


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

Fix an MSVC x64 compiler warning, "warning C4312: 'type cast': conversion from 'unsigned int' to 'int *' of greater size".

The warning (which is valuable) is simple to avoid: widen to uintptr_t, then cast. I'm additionally using C++ casts for clarity.

https://reviews.llvm.org/D22971

Files:
  test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
  test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
  test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22971.66162.patch
Type: text/x-patch
Size: 3687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160729/a2d16b78/attachment.bin>


More information about the cfe-commits mailing list