mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3274: macro for printf format check can be simplified
Problem: Macro for printf format check can be simplified. Solution: Add ATTRIBUTE_FORMAT_PRINTF(). (Dominique Pellé, issue #8635)
This commit is contained in:
17
src/vim.h
17
src/vim.h
@@ -2132,8 +2132,21 @@ typedef struct _stat64 stat_T;
|
||||
typedef struct stat stat_T;
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__MINGW32__)
|
||||
# define USE_PRINTF_FORMAT_ATTRIBUTE
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__)
|
||||
# define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) \
|
||||
__attribute__((format(printf, fmt_idx, arg_idx)))
|
||||
#else
|
||||
# define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define likely(x) __builtin_expect((x), 1)
|
||||
# define unlikely(x) __builtin_expect((x), 0)
|
||||
# define ATTRIBUTE_COLD __attribute__((cold))
|
||||
#else
|
||||
# define unlikely(x) (x)
|
||||
# define likely(x) (x)
|
||||
# define ATTRIBUTE_COLD
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
|
Reference in New Issue
Block a user