summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-10 12:42:44 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-10 12:42:44 +0200
commite80757c1545286240d687e9a303cf8eeb3f9a6de (patch)
treed7815e52f08aa2e5e58faeee86c1d0f8b63ded80
parent756ef113d14428e598274f87672d7f0e34ff9781 (diff)
patch 8.0.1681: the format attribute fails with MinGWv8.0.1681
Problem: The format attribute fails with MinGW. (John Marriott) Solution: Don't use the format attribute with MinGW.
-rw-r--r--src/channel.c4
-rw-r--r--src/proto.h6
-rw-r--r--src/version.c2
-rw-r--r--src/vim.h4
4 files changed, 11 insertions, 5 deletions
diff --git a/src/channel.c b/src/channel.c
index 0f2e52b97b..88c53b7e0d 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -179,8 +179,8 @@ ch_log(channel_T *ch, const char *fmt, ...)
static void
ch_error(channel_T *ch, const char *fmt, ...)
-#ifdef __GNUC__
-__attribute__((format(printf, 2, 3)))
+#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
+ __attribute__((format(printf, 2, 3)))
#endif
;
diff --git a/src/proto.h b/src/proto.h
index 231c53f3bf..655b72cac5 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -120,7 +120,7 @@ int
_RTLENTRYF
# endif
vim_snprintf_add(char *, size_t, char *, ...)
-#ifdef __GNUC__
+#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 3, 4)))
#endif
;
@@ -130,7 +130,7 @@ int
_RTLENTRYF
# endif
vim_snprintf(char *, size_t, char *, ...)
-#ifdef __GNUC__
+#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 3, 4)))
#endif
;
@@ -223,7 +223,7 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void
/* Not generated automatically, to add extra attribute. */
void ch_log(channel_T *ch, const char *fmt, ...)
-#ifdef __GNUC__
+#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 2, 3)))
#endif
;
diff --git a/src/version.c b/src/version.c
index f0a21b3358..d162de5e88 100644
--- a/src/version.c
+++ b/src/version.c
@@ -763,6 +763,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1681,
+/**/
1680,
/**/
1679,
diff --git a/src/vim.h b/src/vim.h
index 626c0ad120..4b41857903 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -2085,6 +2085,10 @@ typedef struct _stat64 stat_T;
typedef struct stat stat_T;
#endif
+#if defined(__GNUC__) && !defined(__MINGW32__)
+# define USE_PRINTF_FORMAT_ATTRIBUTE
+#endif
+
typedef enum
{
ASSERT_EQUAL,