HomePhabricator

[Diagnostics] Refactor code for -Wsizeof-pointer-div, catch more cases; also…

Description

[Diagnostics] Refactor code for -Wsizeof-pointer-div, catch more cases; also add -Wsizeof-array-div

Previously, -Wsizeof-pointer-div failed to catch:
const int *r;
sizeof(r) / sizeof(int);

Now fixed.
Also introduced -Wsizeof-array-div which catches bugs like:
sizeof(r) / sizeof(short);

(Array element type does not match type of sizeof operand).

Details

Committed
xbolva00Fri, Sep 6, 9:12 AM
Parents
rL371221: [SimplifyLibCalls] handle pow(x,-0.0) before it can assert (PR43233)
Branches
Unknown
Tags
Unknown