[clang] [clang][analyzer] Improve PointerSubChecker (PR #96501)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 05:10:22 PDT 2024


NagyDonat wrote:

> Even protobuf contains this type of code: https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=protobuf_v3.13.0_pointersub1&is-unique=on&diff-type=New&checker-name=alpha.core.PointerSub&report-id=5545776&report-hash=1bcd310fbaeccbcc13645b9b277239a2&report-filepath=%2adescriptor.pb.cc

I still think that this
 (1) is undeniably undefined behavior
 (2) isn't common, so won't cause "spam"  problems and
 (3( can be replaced by standard-compliant code (`offsetof`)
so there is no need to introduce a special case for it.

https://github.com/llvm/llvm-project/pull/96501


More information about the cfe-commits mailing list