X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/36eb5d3d77426d8cbf4243ea752f8d8cd1d5c682..ff7829398d74e67f1c1f40339a772fd76708e5ac:/src/src/mytypes.h diff --git a/src/src/mytypes.h b/src/src/mytypes.h index 6d2f169b7..c51c870c2 100644 --- a/src/src/mytypes.h +++ b/src/src/mytypes.h @@ -3,6 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2018 */ +/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -29,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 -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__) -# 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 PRINTF_FUNCTION(A,B) # define ARG_UNUSED /**/ # define WARN_UNUSED_RESULT /**/ # define ALLOC /**/ @@ -47,10 +51,14 @@ the arguments of printf-like functions. This is done by a macro. */ # 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 -# define ALMOST_PRINTF(A, B) +# define ALMOST_PRINTF(A, B) /**/ #endif @@ -124,7 +132,7 @@ functions that are called quite often; for other calls to external libraries #define Ustrtoul(s,t,b) strtoul(CCS(s),CSS(t),b) #define Uunlink(s) unlink(CCS(s)) -#ifdef EM_VERSION_C +#if defined(EM_VERSION_C) || defined(LOCAL_SCAN) || defined(DLFUNC_IMPL) # define Ustrcat(s,t) strcat(CS(s), CCS(t)) # define Ustrcpy(s,t) strcpy(CS(s), CCS(t)) # define Ustrncat(s,t,n) strncat(CS(s), CCS(t), n)