Some of these are pretty hairy and it's a moving codebase. Since they
are applying compiler "printf-like" attribute to functions which are
using their own functions rather than libc printf, and we are purely
making this change to disable the spurious warning because there is
no abort in their %n handling, can't we just disable the annotations
instead?

Index: patches/patch-src_mytypes_h
===================================================================
RCS file: patches/patch-src_mytypes_h
diff -N patches/patch-src_mytypes_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mytypes_h 20 Sep 2021 09:28:21 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Don't do printf-like checks on OpenBSD, which warn about %n use.
+
+Index: src/mytypes.h
+--- src/mytypes.h.orig
++++ src/mytypes.h
+@@ -33,7 +33,11 @@ local_scan.h includes it and exim.h includes them both
+ the arguments of printf-like functions. This is done by a macro. */
+ 
+ #if defined(__GNUC__) || defined(__clang__)
+-# define PRINTF_FUNCTION(A,B) __attribute__((format(printf,A,B)))
++# if defined(__OpenBSD__)
++#  define PRINTF_FUNCTION(A,B)        /**/
++# else
++#  define PRINTF_FUNCTION(A,B)        __attribute__((format(printf,A,B)))
++# endif
+ # define ARG_UNUSED           __attribute__((__unused__))
+ # define WARN_UNUSED_RESULT   __attribute__((__warn_unused_result__))
+ # define ALLOC                        __attribute__((malloc))



Reply via email to