[clang-tools-extra] [clang-tidy] Add AllowStringArrays option to modernize-avoid-c-arrays (PR #71701)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 14:46:06 PST 2024


PiotrZSL wrote:

> I may not work for
> 
> ```c++
> void f(const char name[]);
> 
> f("111");
> ```

It should not work, as this is not array, but pointer. If you do `sizeof(name)` you get size of pointer, instead of number of elements in array.

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


More information about the cfe-commits mailing list