[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 23 23:47:21 PDT 2022


steakhal marked 2 inline comments as done.
steakhal added a comment.

In D136162#3874953 <https://reviews.llvm.org/D136162#3874953>, @martong wrote:

> Thanks for the update. Nice Work!

Thanks! I'll land this tomorrow.



================
Comment at: clang/test/Analysis/region-store.c:66
+  // expected-warning at +1 {{passing arguments to 'b' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+  b(&buffer);
+}
----------------
martong wrote:
> steakhal wrote:
> > NoQ wrote:
> > > steakhal wrote:
> > > > tomasz-kaminski-sonarsource wrote:
> > > > > tomasz-kaminski-sonarsource wrote:
> > > > > > I would like to see an example where the called function is implicitly defined.
> > > > > After rethinking it, I have not idea how to construct that example.
> > > > I could not construct such an example.
> > > > It seems like clang errors out for cases when an implicit declaration of a call mismatches with the definition of that function.
> > > > https://godbolt.org/z/rM9ajeTf7
> > > Yeah, if you scroll really far to the right, you'll see that the first error is actually a warning auto-promoted to an error. So you can pass `-Wno-implicit-function-declaration` and it'll disappear. Not sure what to do with the other error though, it really does notice that the implicit definition conflicts with the later explicit definition. So, dunno.
> > Yup, I should have been more clear on this. See the test, I'm also passing the `-Wno-implicit-function-declaration` :)
> > Maybe Shafik or Aaron knows some weird stuff about how to make it 'compile'. WDYT?
> Interestingly,  GCC trunk compiles it without errors, the warnings are there though.
Hm, interesting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136162



More information about the cfe-commits mailing list