[PATCH] D80887: [clang-tidy] ignore builtin varargs from pro-type-vararg-check

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 05:27:40 PDT 2020


njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:40
+    // "__builtin_va_start",
+    // "__builtin_stdarg_start",
+    "__builtin_assume_aligned", // Documented as variadic to support overloading
----------------
aaron.ballman wrote:
> Should remove commented-out code from the list.
Once we are happy I will remove it, more  a temporary step.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:41
+    // "__builtin_stdarg_start",
+    "__builtin_assume_aligned", // Documented as variadic to support overloading
+    // "__builtin_fprintf",
----------------
aaron.ballman wrote:
> If it's documented as being variadic, I think we want to remove it from the list so we warn on its use, right?
> 
> From here on down look like things that are not part of any standard, also, so we may want to remove them based on that, too.
This function should have this signature if default arguments were allowed.
```
extern void* __builtin_assume_aligned(const void* exp, size_t align, size_t misaligned = 0);```


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:49
+    // "__builtin___printf_chk",
+    "__builtin_prefetch",      // Documented as variadic to support overloading
+    "__builtin_shufflevector", // Documented as variadic but with a defined
----------------
aaron.ballman wrote:
> Same here.
Likewise this one should have this signature
```
extern void ____builtin_prefetch(const void* addr, bool rw = false, unsigned locality = 3);```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80887





More information about the cfe-commits mailing list