git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tidying
[exim.git]
/
src
/
src
/
mytypes.h
diff --git
a/src/src/mytypes.h
b/src/src/mytypes.h
index a3496a2986634400a00f9f204f4ed643e62f3b7b..954f683c828bf0dbd7ac58f200eec2c618026b4a 100644
(file)
--- a/
src/src/mytypes.h
+++ b/
src/src/mytypes.h
@@
-2,8
+2,10
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
+/* Copyright (c) The Exim Maintainers 2020 - 2022 */
/* Copyright (c) University of Cambridge 1995 - 2018 */
/* See the file NOTICE for conditions of use and distribution. */
/* Copyright (c) University of Cambridge 1995 - 2018 */
/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
/* This header file contains type definitions and macros that I use as
/* This header file contains type definitions and macros that I use as
@@
-29,28
+31,41
@@
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 ARG_UNUSED __attribute__((__unused__))
+# define FUNC_MAYBE_UNUSED __attribute__((__unused__))
# define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
# define ALLOC __attribute__((malloc))
# define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
# define ALLOC __attribute__((malloc))
-# define ALLOC_SIZE(A) __attribute__((alloc_size(A)))
# define NORETURN __attribute__((noreturn))
# define NORETURN __attribute__((noreturn))
+# ifndef __clang__
+# define ALLOC_SIZE(A) __attribute__((alloc_size(A)))
+# else
+# define ALLOC_SIZE(A) /**/
+# endif
#else
#else
-# define PRINTF_FUNCTION(A,B)
# define ARG_UNUSED /**/
# define ARG_UNUSED /**/
+# define FUNC_MAYBE_UNUSED /**/
# define WARN_UNUSED_RESULT /**/
# define ALLOC /**/
# define ALLOC_SIZE(A) /**/
# define NORETURN /**/
#endif
# define WARN_UNUSED_RESULT /**/
# define ALLOC /**/
# define ALLOC_SIZE(A) /**/
# 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