]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.0.1681: the format attribute fails with MinGW v8.0.1681
authorBram Moolenaar <Bram@vim.org>
Tue, 10 Apr 2018 10:42:44 +0000 (12:42 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Apr 2018 10:42:44 +0000 (12:42 +0200)
Problem:    The format attribute fails with MinGW. (John Marriott)
Solution:   Don't use the format attribute with MinGW.

src/channel.c
src/proto.h
src/version.c
src/vim.h

index 0f2e52b97b0444b25ac39b8498f7cb56ff743509..88c53b7e0d4d2d483450a02430f4458a284ef5b6 100644 (file)
@@ -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
     ;
 
index 231c53f3bf55f2b220fb287daf0f9db11f45d247..655b72cac5e387b1960fae4dc84befcd4d12940a 100644 (file)
@@ -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
     ;
index f0a21b335808ada39a91e875cf04dec23bc53e09..d162de5e88f465cdb10064a1292ee9930cb46c0a 100644 (file)
@@ -762,6 +762,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1681,
 /**/
     1680,
 /**/
index 626c0ad12015eb58d9730472584f44dbfe74624f..4b41857903d326206706e6dd06d1c487affc85ec 100644 (file)
--- 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,