aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorJamie Schmeiser <schmeise@ca.ibm.com>2021-07-20 10:12:20 -0400
committerJamie Schmeiser <schmeise@ca.ibm.com>2021-07-20 10:12:20 -0400
commit9cb00b9ecbe74d19389a5818d61ddee328afe031 (patch)
tree106491ce57bf912fb5f4f38f839f1bc106fdf4f5 /llvm/lib/Object/Binary.cpp
parent02cd937945f8f044aa52b7967531be2b77b27431 (diff)
downloadllvm-9cb00b9ecbe74d19389a5818d61ddee328afe031.zip
llvm-9cb00b9ecbe74d19389a5818d61ddee328afe031.tar.gz
llvm-9cb00b9ecbe74d19389a5818d61ddee328afe031.tar.bz2
Reland Produce warning for performing pointer arithmetic on a null pointer.
Summary: Test and produce warning for subtracting a pointer from null or subtracting null from a pointer. This reland adds the functionality that the warning is no longer reusing an existing warning, it has different wording for C vs C++ to refect the fact that nullptr-nullptr has defined behaviour in C++, it is suppressed when the warning is triggered by a system header and adds -Wnull-pointer-subtraction to allow the warning to be controlled. -Wextra implies -Wnull-pointer-subtraction. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By: efriedma (Eli Friedman), nickdesaulniers (Nick Desaulniers) Differential Revision: https://reviews.llvm.org/D98798
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
0 files changed, 0 insertions, 0 deletions