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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 06:24:36 PDT 2023


================
@@ -936,6 +936,9 @@ def err_opencl_invalid_param : Error<
 def err_opencl_invalid_return : Error<
   "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
+def warn_missing_format_attribute : Warning<
+  "Function %0 might be candidate for %1 format attribute.">,
+  InGroup<MissingFormatAttribute>, DefaultIgnore;
----------------
AaronBallman wrote:

```suggestion
  "diagnostic behavior may be improved by adding the %0 format attribute to the declaration of %1">,
  InGroup<MissingFormatAttribute>, DefaultIgnore;
```
(likely need to be reformatted for our usual 80-col limits.)

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


More information about the cfe-commits mailing list