[PATCH] D137379: [-Wunsafe-buffer-usage] Add warnings for unsafe buffer accesses by array subscript operations

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 13:15:41 PST 2022


ziqingluo-90 added inline comments.


================
Comment at: clang/test/SemaCXX/warn-unsafe-buffer-usage.cpp:10-13
+void foo(...);
+
+void * bar(void);
+char * baz(void);
----------------
steakhal wrote:
> I would expect this test file to grow quite a bit.
> As such, I think we should have more self-descriptive names for these functions.
> 
> I'm also curious what's the purpose of `foo()`in the examples.
Thanks for the comment.  I agree that they should have better names or at least explaining comments.

> I'm also curious what's the purpose of `foo()`in the examples.

I make all testing expressions arguments of `foo` so that I do not have to create statements to use these expressions while avoiding irrelevant warnings.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137379



More information about the cfe-commits mailing list