[PATCH] D87683: [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 11:30:55 PDT 2020


martong added a comment.

In D87683#2274663 <https://reviews.llvm.org/D87683#2274663>, @baloghadamsoftware wrote:

> In D87683#2274569 <https://reviews.llvm.org/D87683#2274569>, @njames93 wrote:
>
>> Please fix the test case first, can't call `operator new(unsigned long, void*)` with an argument of type `void*`
>> The other failures the pre merge bot detected can safely be disregarded
>
> Placement new is defined per standard:
>
>   void* operator new  ( std::size_t count, void* ptr );
>
> Here, the problem is that `size_t` is `unsigned long` on //Linux// and it seems that it is `unsigned long long` on //Windows//. How should I overcome this?

In CSA, to overcome the platform problem, it is common to add a target triple for the RUN line:
https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/std-c-library-functions.c#L14


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87683



More information about the cfe-commits mailing list