|
|
Created:
4 years, 10 months ago by brucedawson Modified:
4 years, 10 months ago CC:
chromium-reviews, wfh+watch_chromium.org, rickyz+watch_chromium.org, liamjm (20p) Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionUse double cast to avoid VS 2015 64-bit warning
If you convert a 64-bit pointer directly to a 32-bit or smaller integer
then VS 2015 guesses (not unreasonably) that it might be an accidental
pointer truncation. The standard fix is to use a double-cast, to a
pointer-sized integer and then to DWORD.
This fixes a C4311 "pointer truncation" warning introduced by
crrev.com/1225183003
Warning C4312 (conversion from int to ptr of greater size) is suppressed
in this project but adding double-casts for the reverse conversion keeps
the code symmetrical and allows us to enable C4312 in the future.
BUG=440500
Committed: https://crrev.com/e1325fa72f95c4837d19993606954ed0b258be67
Cr-Commit-Position: refs/heads/master@{#374828}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Double casts for DWORD to ptr also #Messages
Total messages: 20 (9 generated)
Description was changed from ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. BUG=440500 ========== to ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a warning introduced by crrev.com/1225183003 BUG=440500 ==========
brucedawson@chromium.org changed reviewers: + thakis@chromium.org
https://codereview.chromium.org/1684963003/diff/1/sandbox/win/src/process_pol... File sandbox/win/src/process_policy_test.cc (right): https://codereview.chromium.org/1684963003/diff/1/sandbox/win/src/process_pol... sandbox/win/src/process_policy_test.cc:317: reinterpret_cast<LPVOID>(pid), 0, &thread_id); this should have a double cast too then – else this happens to work on little-endian but isn't quite right https://codereview.chromium.org/1684963003/diff/1/sandbox/win/src/process_pol... sandbox/win/src/process_policy_test.cc:504: reinterpret_cast<LPVOID>(pid), 0, &thread_id); this too
Description was changed from ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a warning introduced by crrev.com/1225183003 BUG=440500 ========== to ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a C4311 "pointer truncation" warning introduced by crrev.com/1225183003 Warning C4312 (conversion from int to ptr of greater size) is suppressed in this project but adding double-casts for the reverse conversion keeps the code symmetrical and allows us to enable C4312 in the future. BUG=440500 ==========
https://codereview.chromium.org/1684963003/diff/1/sandbox/win/src/process_pol... File sandbox/win/src/process_policy_test.cc (right): https://codereview.chromium.org/1684963003/diff/1/sandbox/win/src/process_pol... sandbox/win/src/process_policy_test.cc:317: reinterpret_cast<LPVOID>(pid), 0, &thread_id); On 2016/02/10 23:48:12, Nico wrote: > this should have a double cast too then – else this happens to work on > little-endian but isn't quite right Little versus big endian shouldn't matter. However, I guess we must have C4312 disabled in this project because there's no warning, but adding the double casts seems reasonable. It will make enabling C4312 easier in the future. https://codereview.chromium.org/1684963003/diff/1/sandbox/win/src/process_pol... sandbox/win/src/process_policy_test.cc:504: reinterpret_cast<LPVOID>(pid), 0, &thread_id); On 2016/02/10 23:48:12, Nico wrote: > this too Done.
lgtm
The CQ bit was checked by brucedawson@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1684963003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1684963003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
brucedawson@chromium.org changed reviewers: + jschuh@chromium.org
Adding an owner for review. jschuh@ can you take a look?
lgtm
The CQ bit was checked by brucedawson@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1684963003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1684963003/20001
Message was sent while issue was closed.
Description was changed from ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a C4311 "pointer truncation" warning introduced by crrev.com/1225183003 Warning C4312 (conversion from int to ptr of greater size) is suppressed in this project but adding double-casts for the reverse conversion keeps the code symmetrical and allows us to enable C4312 in the future. BUG=440500 ========== to ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a C4311 "pointer truncation" warning introduced by crrev.com/1225183003 Warning C4312 (conversion from int to ptr of greater size) is suppressed in this project but adding double-casts for the reverse conversion keeps the code symmetrical and allows us to enable C4312 in the future. BUG=440500 ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a C4311 "pointer truncation" warning introduced by crrev.com/1225183003 Warning C4312 (conversion from int to ptr of greater size) is suppressed in this project but adding double-casts for the reverse conversion keeps the code symmetrical and allows us to enable C4312 in the future. BUG=440500 ========== to ========== Use double cast to avoid VS 2015 64-bit warning If you convert a 64-bit pointer directly to a 32-bit or smaller integer then VS 2015 guesses (not unreasonably) that it might be an accidental pointer truncation. The standard fix is to use a double-cast, to a pointer-sized integer and then to DWORD. This fixes a C4311 "pointer truncation" warning introduced by crrev.com/1225183003 Warning C4312 (conversion from int to ptr of greater size) is suppressed in this project but adding double-casts for the reverse conversion keeps the code symmetrical and allows us to enable C4312 in the future. BUG=440500 Committed: https://crrev.com/e1325fa72f95c4837d19993606954ed0b258be67 Cr-Commit-Position: refs/heads/master@{#374828} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/e1325fa72f95c4837d19993606954ed0b258be67 Cr-Commit-Position: refs/heads/master@{#374828} |