[PATCH] D67287: [Diagnostics] Add -Wsizeof-array-div

James Nagurne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 11:39:38 PDT 2019


JamesNagurne added a comment.

@xbolva00

As mentioned in an inline comment, the test only works if the sizeof(int) != sizeof(int *) and sizeof(unsigned long long) == sizeof(int)

The test then also runs clang -cc1 with the default target. This means the test asserts that all clang targets match the assertions above.

My team supports an embedded ARM default LLVM product, and this test is now failing on our end because int is 4 bytes, unsigned long long is 8 bytes, and int * is 4 bytes.
This test needs to either work for all targets (via some macro hackery) or the target needs to be made explicit, which I believe would be preferable because the warning itself is not reliant upon the target, only the type sizes.

For instance, adding -triple x86_64-unknown-linux-gnu fixes the test on our embedded ARM toolchain.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67287/new/

https://reviews.llvm.org/D67287





More information about the llvm-commits mailing list