[clang] [clang] Catch missing format attributes (PR #70024)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 06:34:59 PST 2023


================
@@ -0,0 +1,58 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -Wmissing-format-attribute %s
----------------
AaronBallman wrote:

```suggestion
```
Our default is C17 and there's no C99-specific logic to be tested, so I think we can remove this RUN line. We should add some C++ tests though. Other tests to consider for C++ would be:
```
void func(const std::string &str, ...);
void func(std::string_view str, ...);
void func(const std::wstring &str, ...);
void func(std::wstring_view str, ...);
// Same for the other string types like char8_t and friends?
```
and other tests for C include:
```
void func(const char str[], ...);
void func(const wchar_t *str, ...);
// Same for the other string types like char8_t and friends?
```

https://github.com/llvm/llvm-project/pull/70024


More information about the cfe-commits mailing list