$OpenBSD: patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td,v 1.10 2021/09/19 17:49:23 jca Exp $

- Disable -Waddress-of-packed-member by default.

While these warnings have the potential to be useful, there are too many
false positives right now.

- Disable -Wpointer-sign warnings per default

base gcc does the same.

- Add a new warning for %n format specifier usage in printf(3) family functions

Index: tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
--- tools/clang/include/clang/Basic/DiagnosticSemaKinds.td.orig
+++ tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -6440,7 +6440,7 @@ def warn_pointer_indirection_from_incompatible_type : 
   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
 def warn_taking_address_of_packed_member : Warning<
   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
-  InGroup<DiagGroup<"address-of-packed-member">>;
+  InGroup<DiagGroup<"address-of-packed-member">>, DefaultIgnore;
 
 def err_objc_object_assignment : Error<
   "cannot assign to class object (%0 invalid)">;
@@ -7607,7 +7607,7 @@ def ext_typecheck_convert_incompatible_pointer_sign : 
   "sending to parameter of different type}0,1"
   "|%diff{casting $ to type $|casting between types}0,1}2"
   " converts between pointers to integer types with different sign">,
-  InGroup<DiagGroup<"pointer-sign">>;
+  InGroup<DiagGroup<"pointer-sign">>, DefaultIgnore;
 def err_typecheck_convert_incompatible_pointer_sign : Error<
   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
   "|%diff{passing $ to parameter of type $|"
@@ -9103,6 +9103,9 @@ def err_os_log_argument_too_big : Error<
   "os_log() argument %0 is too big (%1 bytes, max %2)">;
 def warn_os_log_format_narg : Error<
  "os_log() '%%n' format specifier is not allowed">, DefaultError;
+
+def warn_format_narg : Warning<
+  "'%%n' format specifier support is deactivated and will call abort(3)">;
 
 // Statements.
 def err_continue_not_in_loop : Error<
