vbvictor wrote:

> You can probably also add the -Wstrict-prototypes to the ExtraArgs field in 
> the .clang-tidy file.

This is a good workaround (maybe not very well-known)
So you have config
```yaml
# .clang-tidy
Checks: clang-diagnostic-strict-prototypes
ExtraArgs: ["-Wstrict-prototypes"]
```
Then you can have clang's output in clang-tidy:
```
main.c:1:22: warning: a function declaration without a prototype is deprecated 
in all versions of C [clang-diagnostic-strict-prototypes]
    1 |  void foo(void (*ptr)(), int y);
      |                      ^
      |                       void
main.c:3:11: warning: a function declaration without a prototype is deprecated 
in all versions of C [clang-diagnostic-strict-prototypes]
    3 |   int main() {
      |           ^
      |            void
main.c:4:16: warning: a function declaration without a prototype is deprecated 
in all versions of C [clang-diagnostic-strict-prototypes]
    4 |     void (*ptr)() = &foo;
      |                ^
      |                 void

```

https://github.com/llvm/llvm-project/pull/161023
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to