summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/div-sizeof-array.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Diagnostics] Silence -Wsizeof-array-div for character buffersJames Clarke2019-10-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Character buffers are sometimes used to represent a pool of memory that contains non-character objects, due to them being synonymous with a stream of bytes on almost all modern architectures. Often, when interacting with hardware devices, byte buffers are therefore used as an intermediary and so we can end Character buffers are sometimes used to represent a pool of memory that contains non-character objects, due to them being synonymous with a stream of bytes on almost all modern architectures. Often, when interacting with hardware devices, byte buffers are therefore used as an intermediary and so we can end up generating lots of false-positives. Moreover, due to the ability of character pointers to alias non-character pointers, the strict aliasing violations that would generally be implied by the calculations caught by the warning (if the calculation itself is in fact correct) do not apply here, and so although the length calculation may be wrong, that is the only possible issue. Reviewers: rsmith, xbolva00, thakis Reviewed By: xbolva00, thakis Subscribers: thakis, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68526 llvm-svn: 374035
* [Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested ↵David Bolvansky2019-09-231-13/+10
| | | | | | array by the size of the deepest base type llvm-svn: 372600
* [Diagnostics] Added silence note for -Wsizeof-array-div; suggest extra parensDavid Bolvansky2019-09-141-3/+20
| | | | llvm-svn: 371924
* [NFC] Added triple to test file to avoid arm buildbots failuresDavid Bolvansky2019-09-111-1/+2
| | | | llvm-svn: 371646
* [Diagnostics] Add -Wsizeof-array-divDavid Bolvansky2019-09-111-0/+28
| | | | | | | | | | Summary: Clang version of https://www.viva64.com/en/examples/v706/ Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D67287 llvm-svn: 371605
* [NFCI] Unbreak buildbotsDavid Bolvansky2019-09-061-26/+0
| | | | llvm-svn: 371226
* [NFC] Added new tests for r371222David Bolvansky2019-09-061-0/+26
llvm-svn: 371223
OpenPOWER on IntegriCloud