From: Bruno Haible Date: Tue, 3 Jul 2018 21:17:37 +0000 (+0200) Subject: Enable the format_arg attribute also on clang on Mac OS X. X-Git-Tag: v0.20~403 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd6a52241c7c83c90e043ace2082a2508d273f55;p=thirdparty%2Fgettext.git Enable the format_arg attribute also on clang on Mac OS X. Reported by Tom Tromey in . * gettext-runtime/intl/libgnuintl.in.h (_INTL_MAY_RETURN_STRING_ARG): On macOS, use attribute __format_arg__ if the compiler is based on clang >= 3.0. --- diff --git a/gettext-runtime/intl/libgnuintl.in.h b/gettext-runtime/intl/libgnuintl.in.h index 019c6e115..5637fda02 100644 --- a/gettext-runtime/intl/libgnuintl.in.h +++ b/gettext-runtime/intl/libgnuintl.in.h @@ -111,7 +111,7 @@ extern int libintl_version; /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return its n-th argument literally. This enables GCC to warn for example about printf (gettext ("foo %y")). */ -#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus) +#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && !(defined __clang__ && __clang__ && __clang_major__ >= 3) && defined __cplusplus) # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) #else # define _INTL_MAY_RETURN_STRING_ARG(n)