Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-10-07 Thread Dávid Bolvanský via cfe-commits
D68526 should fix it. Take a look please. > Dňa 7. 10. 2019 o 17:09 užívateľ Nico Weber napísal: > >  > I gave this another try now that we have a compiler with rL372600. Another > thing the warning currently warns on is code like this: > > char memory[kOpcodeMemory]; > OpcodeFactory

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-10-07 Thread Nico Weber via cfe-commits
I gave this another try now that we have a compiler with rL372600. Another thing the warning currently warns on is code like this: char memory[kOpcodeMemory]; OpcodeFactory opcode_maker(memory, sizeof(memory)); size_t count = sizeof(memory) / sizeof(PolicyOpcode); or int32_t

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-23 Thread Dávid Bolvanský via cfe-commits
Yeah, this needs to be handled a bit differently (if we want so). po 23. 9. 2019 o 15:07 Nico Weber napísal(a): > It still warns if the inner array is in a struct. That's probably ok > though. > > struct Point { > int xy[2]; > }; > > void f() { > Point points[3]; > for (int i = 0; i <

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-23 Thread Nico Weber via cfe-commits
It still warns if the inner array is in a struct. That's probably ok though. struct Point { int xy[2]; }; void f() { Point points[3]; for (int i = 0; i < sizeof(points) / sizeof(int); ++i) ([0].xy[0])[i] = 0; } On Mon, Sep 23, 2019 at 8:54 AM Nico Weber wrote: > That was fast.

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-23 Thread Nico Weber via cfe-commits
That was fast. Thanks much! :) On Mon, Sep 23, 2019 at 8:52 AM Dávid Bolvanský wrote: > Hello, > > Thanks for the proposed idea, implemented in rL372600. > > po 23. 9. 2019 o 14:23 Nico Weber napísal(a): > >> We're looking at turning this one. >> >> One thing that this warns about that's a

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-23 Thread Dávid Bolvanský via cfe-commits
Hello, Thanks for the proposed idea, implemented in rL372600. po 23. 9. 2019 o 14:23 Nico Weber napísal(a): > We're looking at turning this one. > > One thing that this warns about that's a false positive where we've seen > it is this code for nested arrays: > > float m[4][4]; > for (int i

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-23 Thread Nico Weber via cfe-commits
We're looking at turning this one. One thing that this warns about that's a false positive where we've seen it is this code for nested arrays: float m[4][4]; for (int i = 0; i < sizeof(m) / sizeof(**m); ++i) (&**m)[i] = 0; (Why would anyone write code like this? It's a reduced example;

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-11 Thread Dávid Bolvanský via cfe-commits
Thanks, Reproduced with -triple armv7–. Added triple to run line, hopefully it will fix the bots. I will check this buildbot if all ok. rL371646 Dňa 11. 9. 2019 o 20:35 užívateľ Yvan Roux napísal: > Hi David, > > This commit broken ARMv7 bots, logs are available here: > >

Re: r371605 - [Diagnostics] Add -Wsizeof-array-div

2019-09-11 Thread Yvan Roux via cfe-commits
Hi David, This commit broken ARMv7 bots, logs are available here: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10203/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Adiv-sizeof-array.cpp Thanks, Yvan On Wed, 11 Sep 2019 at 12:58, David Bolvansky via cfe-commits wrote: >