[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions 🙈
Stephane Moore via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 12 17:11:28 PST 2019
stephanemoore added inline comments.
================
Comment at: clang-tools-extra/test/clang-tidy/google-objc-function-naming.m:10
+// function would be declared in a system header.
+int printf(const char *, ...); // NOLINT(google-objc-function-naming)
+
----------------
aaron.ballman wrote:
> stephanemoore wrote:
> > Thus far I have been unsuccessful in using line markers to simulate this declaration being in a system header but I did discover precedence for using NOLINT to suppress diagnostics in some of the clang-tidy tests:
> > https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/test/clang-tidy/google-runtime-int-std.cpp#L11
> > https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/test/clang-tidy/google-runtime-int.cpp#L6
> >
> > I think it should be reasonable to suppress the diagnostic here with a comment explaining why. Let me know if you don't think that's an appropriate solution and I can continue investigating for a potential solution using line markers.
> Personally, I would recommend adding stdio.h to extra\test\clang-tidy\Inputs\Headers and adding a `-isystem` to this test's RUN line. You could also add `#pragma clang system_header` to the file to be really sure it's treated as a system header. This gives us a place to add more stdio.h declarations in the future as well.
>
That sounds like a better idea. Thanks for the suggestion!
Things seem to work without needing `#pragma clang system_header` so I left it out. If you want me to include that, I can do so.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58095/new/
https://reviews.llvm.org/D58095
More information about the cfe-commits
mailing list