Mercurial > vim
comparison src/vim.h @ 25475:038eb6d9003a v8.2.3274
patch 8.2.3274: macro for printf format check can be simplified
Commit: https://github.com/vim/vim/commit/952d9d827e5bfc66a6b1d39956e4e5596b09e2bd
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 2 18:07:18 2021 +0200
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 https://github.com/vim/vim/issues/8635)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 02 Aug 2021 18:15:06 +0200 |
parents | 05f9e8f2016c |
children | 154663508d9b |
comparison
equal
deleted
inserted
replaced
25474:c79b2530406a | 25475:038eb6d9003a |
---|---|
2130 typedef struct _stat64 stat_T; | 2130 typedef struct _stat64 stat_T; |
2131 #else | 2131 #else |
2132 typedef struct stat stat_T; | 2132 typedef struct stat stat_T; |
2133 #endif | 2133 #endif |
2134 | 2134 |
2135 #if defined(__GNUC__) && !defined(__MINGW32__) | 2135 #if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__) |
2136 # define USE_PRINTF_FORMAT_ATTRIBUTE | 2136 # define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) \ |
2137 __attribute__((format(printf, fmt_idx, arg_idx))) | |
2138 #else | |
2139 # define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) | |
2140 #endif | |
2141 | |
2142 #if defined(__GNUC__) || defined(__clang__) | |
2143 # define likely(x) __builtin_expect((x), 1) | |
2144 # define unlikely(x) __builtin_expect((x), 0) | |
2145 # define ATTRIBUTE_COLD __attribute__((cold)) | |
2146 #else | |
2147 # define unlikely(x) (x) | |
2148 # define likely(x) (x) | |
2149 # define ATTRIBUTE_COLD | |
2137 #endif | 2150 #endif |
2138 | 2151 |
2139 typedef enum { | 2152 typedef enum { |
2140 ASSERT_EQUAL, | 2153 ASSERT_EQUAL, |
2141 ASSERT_NOTEQUAL, | 2154 ASSERT_NOTEQUAL, |