[PATCH] D116635: Add warning to detect when calls passing arguments are made to functions without prototypes.
Dan Liew via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 4 17:37:49 PST 2022
delcypher added inline comments.
================
Comment at: clang/test/Sema/warn-calls-without-prototype.c:39
+ return a + b +c;
+}
+
----------------
@NoQ Any ideas about this? It seems kind of weird that when merging `not_a_prototype3` prototype with the K&R style definition of `not_a_prototype3` that the resulting FunctionDecl we see at the call site in `call_to_function_without_prototype3` is marked as not having a prototype.
If I flip the order (see `not_a_prototype6`) then the merged declaration is marked as having a prototype.
I'm not sure if this is a bug in `Sema::MergeFunctionDecl` or if this just a peculiarity of K&R style function definitions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116635/new/
https://reviews.llvm.org/D116635
More information about the cfe-commits
mailing list