git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8b78698
)
OpenBSD: disable compiler-time param checking for string_sprintf() etc
author
Jeremy Harris
<jgh146exb@wizmail.org>
Mon, 20 Sep 2021 21:41:04 +0000
(22:41 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Mon, 20 Sep 2021 21:41:04 +0000
(22:41 +0100)
src/src/mytypes.h
patch
|
blob
|
history
diff --git
a/src/src/mytypes.h
b/src/src/mytypes.h
index 8ae7cbbb45e6509c0eeee0dc74c0824f85f18898..38ee93d8ca034276ea6eaa9f65562e737f11181b 100644
(file)
--- a/
src/src/mytypes.h
+++ b/
src/src/mytypes.h
@@
-30,17
+30,20
@@
local_scan.h includes it and exim.h includes them both (to get this earlier). */
/* If gcc is being used to compile Exim, we can use its facility for checking
/* If gcc is being used to compile Exim, we can use its facility for checking
-the arguments of printf-like functions. This is done by a macro. */
+the arguments of printf-like functions. This is done by a macro.
+OpenBSD has unfortunately taken to objecting to use of %n in printf
+so we have to give up on all of the available parameter checking. */
#if defined(__GNUC__) || defined(__clang__)
#if defined(__GNUC__) || defined(__clang__)
-# define PRINTF_FUNCTION(A,B) __attribute__((format(printf,A,B)))
+# ifndef __OpenBSD__
+# 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))
# define ALLOC_SIZE(A) __attribute__((alloc_size(A)))
# define NORETURN __attribute__((noreturn))
#else
# define ARG_UNUSED __attribute__((__unused__))
# define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
# define ALLOC __attribute__((malloc))
# define ALLOC_SIZE(A) __attribute__((alloc_size(A)))
# define NORETURN __attribute__((noreturn))
#else
-# define PRINTF_FUNCTION(A,B)
# define ARG_UNUSED /**/
# define WARN_UNUSED_RESULT /**/
# define ALLOC /**/
# define ARG_UNUSED /**/
# define WARN_UNUSED_RESULT /**/
# define ALLOC /**/
@@
-48,10
+51,14
@@
the arguments of printf-like functions. This is done by a macro. */
# define NORETURN /**/
#endif
# define NORETURN /**/
#endif
+#ifndef PRINTF_FUNCTION
+# define PRINTF_FUNCTION(A,B) /**/
+#endif
+
#ifdef WANT_DEEPER_PRINTF_CHECKS
# define ALMOST_PRINTF(A, B) PRINTF_FUNCTION(A, B)
#else
#ifdef WANT_DEEPER_PRINTF_CHECKS
# define ALMOST_PRINTF(A, B) PRINTF_FUNCTION(A, B)
#else
-# define ALMOST_PRINTF(A, B)
+# define ALMOST_PRINTF(A, B)
/**/
#endif
#endif