[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions 🙈

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 12 05:32:40 PST 2019


aaron.ballman added inline comments.
Herald added a subscriber: jdoerfert.


================
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)
+
----------------
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.



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