Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
patch 8.0.1681: the format attribute fails with MinGW
Problem:    The format attribute fails with MinGW. (John Marriott)
Solution:   Don't use the format attribute with MinGW.
  • Loading branch information
brammool committed Apr 10, 2018
1 parent 756ef11 commit e80757c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/channel.c
Expand Up @@ -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
;

Expand Down
6 changes: 3 additions & 3 deletions src/proto.h
Expand Up @@ -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
;
Expand All @@ -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
;
Expand Down Expand Up @@ -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
;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -762,6 +762,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1681,
/**/
1680,
/**/
Expand Down
4 changes: 4 additions & 0 deletions src/vim.h
Expand Up @@ -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,
Expand Down

0 comments on commit e80757c

Please sign in to comment.